Here you can find the source of stringJoin(java.util.Collection> s, String delimiter)
public static String stringJoin(java.util.Collection<?> s, String delimiter)
//package com.java2s; //License from project: BSD License public class Main { public static String stringJoin(java.util.Collection<?> s, String delimiter) { StringBuilder builder = new StringBuilder(); java.util.Iterator<?> iter = s.iterator(); while (iter.hasNext()) { builder.append(iter.next()); if (!iter.hasNext()) { break; }//from w w w .ja va2s . co m builder.append(delimiter); } return builder.toString(); } }