Here you can find the source of join(List> arr, String seperator)
public static String join(List<?> arr, String seperator)
//package com.java2s; //License from project: Open Source License import java.util.List; public class Main { public static String join(List<?> arr, String seperator) { StringBuilder str = new StringBuilder(); boolean isFirst = true; for (Object item : arr) { if (!isFirst) { str.append(seperator);// w w w . j a v a 2 s . co m } str.append(item); isFirst = false; } return str.toString(); } }