Here you can find the source of toStringWithDelimiters(Collection objects, String delim)
public static String toStringWithDelimiters(Collection objects, String delim)
//package com.java2s; //License from project: LGPL import java.util.*; public class Main { public static String toStringWithDelimiters(Collection objects, String delim) { StringBuffer buffer = new StringBuffer(); int index = 0; for (Object obj : objects) { if (index++ > 0) buffer.append(delim);/*from w w w . jav a 2s. c om*/ buffer.append(obj); } return buffer.toString(); } }