public static String join(String separator,List<String> strings){
  StringBuilder sb=new StringBuilder();
  for (Iterator<String> iter=strings.iterator(); iter.hasNext(); ) {
    String s=iter.next();
    sb.append(s);
    if (iter.hasNext())     sb.append(separator);
  }
  return sb.toString();
}

public static String join ( String separator , List < String > strings ) { StringBuilder sb = new StringBuilder ( ) ; for ( Iterator < String > iter = strings . iterator ( ) ; iter . hasNext ( ) ; ) { String s = iter . next ( ) ; sb . append ( s ) ; if ( iter . hasNext ( ) ) sb . append ( separator ) ; } return sb . toString ( ) ; }
reverse of string . split . glues together the strings and inserts the separator between each consecutive pair .
