Here you can find the source of implode(List
public static String implode(List<String> list, String glue)
//package com.java2s; //License from project: Apache License import java.util.*; public class Main { public static String implode(List<String> list, String glue) { StringBuilder ret = new StringBuilder(); for (int i = 0; i < list.size(); i++) { if (i != 0) { ret.append(glue);/*from w w w .ja v a 2 s .co m*/ } ret.append(list.get(i)); } return ret.toString(); } }