Here you can find the source of commaSeparatedString(List
static public String commaSeparatedString(List<String> strings)
//package com.java2s; import java.util.List; public class Main { static public String commaSeparatedString(List<String> strings) { String mainString = ""; for (String string : strings) mainString += "," + string; mainString.replaceFirst(",", ""); return mainString; }//from ww w.ja v a 2s .co m }