public static String join(Collection c,String delimiter){
  StringBuffer buffer=new StringBuffer();
  Iterator iter=c.iterator();
  while (iter.hasNext()) {
    buffer.append(iter.next());
    if (iter.hasNext()) {
      buffer.append(delimiter);
    }
  }
  return buffer.toString();
}

public static String join ( Collection c , String delimiter ) { StringBuffer buffer = new StringBuffer ( ) ; Iterator iter = c . iterator ( ) ; while ( iter . hasNext ( ) ) { buffer . append ( iter . next ( ) ) ; if ( iter . hasNext ( ) ) { buffer . append ( delimiter ) ; } } return buffer . toString ( ) ; }
joins the elements of a collection into a string .
