Here you can find the source of csv(Collection> col)
Parameter | Description |
---|---|
col | a parameter |
public static String csv(Collection<?> col)
//package com.java2s; import java.util.Collection; public class Main { /**/*from w ww.j a va 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(); } }