Here you can find the source of CollectionToStr(Collection
public static String CollectionToStr(Collection<String> coll)
//package com.java2s; import java.util.Collection; public class Main { public static String CollectionToStr(Collection<String> coll) { StringBuffer sb = new StringBuffer(); int i = 0; for (String string : coll) { if (i > 0) { sb.append(","); }/*from w w w. j a v a2 s . c o m*/ i++; sb.append(string); } return sb.toString(); } }