Here you can find the source of join(List
public static String join(List<String> s, String sep)
//package com.java2s; //License from project: LGPL import java.util.List; public class Main { public static String join(List<String> s, String sep) { String r = s.get(0);//from w w w . j a v a 2 s . co m for (int i = 1; i < s.size(); i++) { r += sep + s.get(i); } return r; } }