Here you can find the source of getListAsCommaSeparatedString(List
public static String getListAsCommaSeparatedString(List<String> list)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static String getListAsCommaSeparatedString(List<String> list) { if (list == null || list.isEmpty()) { return null; }//w w w . j a va 2s.com StringBuilder sb = new StringBuilder(); for (String key : list) { sb.append(key); sb.append(","); } sb.setLength(sb.length() - 1); return sb.toString(); } }