Here you can find the source of convertCollectionToString( Collection
public static String convertCollectionToString( Collection<String> strings, String separator)
//package com.java2s; //License from project: Apache License import java.util.Collection; public class Main { public static String convertCollectionToString( Collection<String> strings, String separator) { String result = ""; boolean first = true; for (String s : strings) { if (first) { result += s;/*from ww w . j a v a2 s . c om*/ first = false; } else { result += separator + s; } } return result; } }