public String join(List<String> list,String delim){
  StringBuilder sb=new StringBuilder();
  String loopDelim="";
  for (  String s : list) {
    sb.append(loopDelim);
    sb.append(s);
    loopDelim=delim;
  }
  return sb.toString();
}

public String join ( List < String > list , String delim ) { StringBuilder sb = new StringBuilder ( ) ; String loopDelim = "" ; for ( String s : list ) { sb . append ( loopDelim ) ; sb . append ( s ) ; loopDelim = delim ; } return sb . toString ( ) ; }
joins the given list of strings using the given delimiter delim
