Here you can find the source of toCSVString(String[] strArray)
public static String toCSVString(String[] strArray)
//package com.java2s; import java.util.Arrays; import java.util.Iterator; public class Main { public static String toCSVString(String[] strArray) { if (strArray == null) return null; StringBuilder sb = new StringBuilder(); for (Iterator<String> itr = Arrays.asList(strArray).iterator(); itr.hasNext();) { String s = itr.next(); sb.append(s);/*from w w w . j a va2s .co m*/ if (itr.hasNext()) sb.append(","); } return sb.toString(); } }