Here you can find the source of toCommaSeperatedList(List
public static String toCommaSeperatedList(List<String> values)
//package com.java2s; import java.util.List; public class Main { public static String toCommaSeperatedList(List<String> values) { StringBuilder result = new StringBuilder(); for (String string : values) { result.append(",").append(string); }//from w ww . j a v a 2 s. com return result.toString().replaceFirst(",", ""); } }