Here you can find the source of implode(String glue, ArrayList
public static String implode(String glue, ArrayList<String> strings)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static String implode(String glue, ArrayList<String> strings) { if (strings.isEmpty()) { return ""; }//w ww . j a va 2 s . com StringBuilder builder = new StringBuilder(); builder.append(strings.remove(0)); for (String str : strings) { builder.append(glue); builder.append(str); } return builder.toString(); } }