Here you can find the source of doMerge(List
private static String doMerge(List<String> list, String sep)
//package com.java2s; // it under the terms of the GNU Affero General Public License as published by import java.util.List; public class Main { private static String doMerge(List<String> list, String sep) { StringBuilder builder = new StringBuilder(); for (String s : list) { builder.append(s);/*from ww w . j a v a 2 s . c o m*/ builder.append(sep); } return builder.toString(); } }