Android examples for java.io:CSV
Creates a comma separated value from the collection elements for csv
import java.text.SimpleDateFormat; import java.util.Collection; import java.util.Date; public class Main{ /**/* w w w. j a v a 2s . c o m*/ * Creates a comma separated value from the collection elements * using the toString method * @param col * @return */ public static String csv(Collection<?> col) { StringBuilder sb = new StringBuilder(); int i = 0; for (Object c : col) { if (i > 0) { sb.append(","); } sb.append(c.toString()); i++; } return sb.toString(); } }