Here you can find the source of stringJoin(List
public static String stringJoin(List<String> list, String sep)
//package com.java2s; //The contents of this file are subject to the "Simplified BSD License" (the "License"); import java.util.List; public class Main { public static String stringJoin(List<String> list, String sep) { if (list == null) return null; StringBuilder sb = new StringBuilder(); for (String s : list) { if (sb.length() > 0) sb.append(sep);/* w w w. j a va2 s . c o m*/ sb.append(s); } return sb.toString(); } }