Here you can find the source of concatStringsWSep(Collection
public static String concatStringsWSep(Collection<String> strings, String separator)
//package com.java2s; import java.util.Collection; public class Main { public static String concatStringsWSep(Collection<String> strings, String separator) { StringBuilder sb = new StringBuilder(); String sep = ""; for (String s : strings) { sb.append(sep).append(s);//from w w w . java 2 s .co m sep = separator; } return sb.toString(); } }