Here you can find the source of getCSVFromList(List
static public String getCSVFromList(List<String> myList)
//package com.java2s; import java.util.List; import java.util.Iterator; public class Main { static public String getCSVFromList(List<String> myList) { String output = null;//from ww w.j a va 2 s. co m Iterator<String> iter = myList.iterator(); while (iter.hasNext()) { String curVal = (String) iter.next(); if (null == output) { output = curVal; } else { output = output + "," + curVal; } } if (null == output) { return ""; } return output; } }