var ooo = ['a','b','c']; var csv = ooo.join(); // output: a,b,c
java裡可以用
org.apache.commons.lang.StringUtils
String[] stringArray = {"a","b","c"}; List<string> stringList = Arrays.asList(stringArray); StringUtils.join( stringArray, "," ); // output:a,b,c StringUtils.join( stringList, "," ); // output:a,b,c
沒有留言:
張貼留言