Here you can find the source of combine(List
public static String combine(List<String> strlist, String delimiter)
//package com.java2s; import java.util.List; public class Main { /** @METHOD */ public static String combine(List<String> strlist, String delimiter) { StringBuilder buf = new StringBuilder(); if (strlist.isEmpty() == false) { for (int i = 0; i < strlist.size(); i++) { String elem = strlist.get(i); buf.append(elem);//w ww . j a va2s. c o m if (i != strlist.size() - 1) buf.append(delimiter); } } return buf.toString(); } }