Here you can find the source of convertCollectionToString(Collection
public static String convertCollectionToString(Collection<String> coll, String delimiter)
//package com.java2s; //License from project: Open Source License import java.util.Collection; public class Main { public static String convertCollectionToString(Collection<String> coll, String delimiter) {//from w ww. j a v a 2 s . c om if (coll == null) { return null; } StringBuilder sb = new StringBuilder(); for (String value : coll) { sb.append(value); sb.append(delimiter); } if (sb.length() > 0) { sb.delete(sb.length() - delimiter.length(), sb.length()); } return sb.toString(); } }