Here you can find the source of toCommaSeparated(List
public static String toCommaSeparated(List<String> list)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String toCommaSeparated(List<String> list) { StringBuilder sb = new StringBuilder(); for (String property : list) { sb.append(property).append(","); }/*from w ww .j a v a 2 s . c om*/ sb.deleteCharAt(sb.length() - 1); return sb.toString(); } }