Here you can find the source of toDelimitedList(Collection
public static <T> String toDelimitedList(Collection<T> values, String delimiter)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static <T> String toDelimitedList(Collection<T> values, String delimiter) { StringBuilder sb = new StringBuilder(); boolean first = true; for (T value : values) { if (first) { first = false;/*from w w w .java2 s . c o m*/ } else { sb.append(delimiter); } sb.append(value); } return sb.toString(); } }