Here you can find the source of joinArrayList(String joiner, ArrayList
public static String joinArrayList(String joiner, ArrayList<String> array)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { public static String joinArrayList(String joiner, ArrayList<String> array) { String result = ""; for (int i = 0; i < array.size(); i++) { result += array.get(i);/* w w w . j a v a2s. co m*/ if (i < array.size() - 1) { result += joiner; } } return result; } }