Here you can find the source of join(final String delimiter, List> values)
Parameter | Description |
---|---|
delimiter | a parameter |
values | a parameter |
public static String join(final String delimiter, List<?> values)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { /**/*w w w .j a v a2 s.co m*/ * Join values to string * @param delimiter * @param values * @return String */ public static String join(final String delimiter, List<?> values) { final StringBuilder sb = new StringBuilder(); for (final Object v : values) { if (sb.length() > 0) { sb.append(delimiter); } sb.append(v); } return sb.toString(); } }