Here you can find the source of listToString(List a, String separator)
public static String listToString(List a, String separator)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String listToString(List a, String separator) { StringBuffer result = new StringBuffer(); if (a.size() > 0) { result.append(a.get(0).toString()); for (int i = 1; i < a.size(); i++) { result.append(separator); result.append(a.get(i).toString()); }//from w w w . j a v a2 s . c o m } return result.toString(); } }