Here you can find the source of concat(List
public static String concat(List<String> strings, String separator)
//package com.java2s; //License from project: Apache License import java.util.List; public class Main { public static String concat(List<String> strings, String separator) { StringBuilder sb = new StringBuilder(); String sep = ""; for (String s : strings) { sb.append(sep).append(s);// ww w .j a v a 2 s .c o m sep = separator; } return sb.toString(); } }