Here you can find the source of implode(ArrayList elements, String connector)
public static String implode(ArrayList elements, String connector)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static String implode(ArrayList elements, String connector) { String retValue = null;/*from w ww . ja va2 s. c o m*/ // clauseElements is a ArrayList with Strings in it; connector is to conncet the elements if (elements.size() > 0) { retValue = ""; int size = elements.size(); for (int i = 0; i < size; i++) { if (i > 0) { retValue += connector; } retValue += elements.get(i).toString(); } } return retValue; } }