Here you can find the source of concatNames(Collection
public static String concatNames(Collection<String> cNames, String split)
//package com.java2s; import java.util.*; public class Main { public static String concatNames(Collection<String> cNames, String split) { String cNames$ = ""; for (String name : cNames) cNames$ += name + split;//from w ww . j a v a 2 s .co m if (cNames$.length() > 0) cNames$ = cNames$.substring(0, cNames$.length() - 1); return cNames$; } public static String concatNames(String[] cNames, String split) { String cNames$ = ""; for (String name : cNames) cNames$ += name + split; if (cNames$.length() > 0) cNames$ = cNames$.substring(0, cNames$.length() - 1); return cNames$; } public static String concatNames(double[] cNames, String split) { String cNames$ = ""; for (double name : cNames) cNames$ += "" + name + split; if (cNames$.length() > 0) cNames$ = cNames$.substring(0, cNames$.length() - 1); return cNames$; } }