java将数组或者arrayList转换成字符串并用逗号分隔

引入apache.commons.lang3的jar包
//ArrayList arr = new ArrayList ();
//String arr[] = new String []{};
String str = StringUtils.join(arr ,",");

你可能感兴趣的:(java中的String)