Here you can find the source of joinList(ArrayList
private static String joinList(ArrayList<String> list, String joint)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { private static String joinList(ArrayList<String> list, String joint) { StringBuilder joinedList = new StringBuilder(); for (String item : list) { joinedList.append(item);/* ww w . j a v a 2s .c o m*/ joinedList.append(joint); } if (joinedList.length() > 0) joinedList.setLength(joinedList.length() - 1); return joinedList.toString(); } }