Here you can find the source of Join(ArrayList
public static String Join(ArrayList<String> coll, String delimiter)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static String Join(ArrayList<String> coll, String delimiter) { if (coll.isEmpty()) return ""; StringBuilder sb = new StringBuilder(); for (String x : coll) sb.append(x + delimiter);//from w w w .j a va 2 s .c o m sb.delete(sb.length() - delimiter.length(), sb.length()); return sb.toString(); } }