Here you can find the source of join(List list, String delim)
public static String join(List list, String delim)
//package com.java2s; //License from project: Open Source License import java.util.Iterator; import java.util.List; public class Main { public static String join(List list, String delim) { if (list == null || list.size() < 1) return null; StringBuffer buf = new StringBuffer(); Iterator i = list.iterator(); while (i.hasNext()) { buf.append((String) i.next()); if (i.hasNext()) buf.append(delim);/* ww w. ja va 2 s. c o m*/ } return buf.toString(); } }