private static String joinArray(String[] array,String delimiter){
  StringBuffer buffer=new StringBuffer();
  for (int index=0; index < array.length; index++) {
    buffer.append(array[index]);
    if (index < array.length - 1) {
      buffer.append(delimiter);
    }
  }
  return buffer.toString();
}

private static String joinArray ( String [ ] array , String delimiter ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int index = 0 ; index < array . length ; index ++ ) { buffer . append ( array [ index ] ) ; if ( index < array . length - 1 ) { buffer . append ( delimiter ) ; } } return buffer . toString ( ) ; }
returns a string created by each element of the array , separated by delimiter .
