public static String concatenate(String[] lines,String delimiter){
  StringBuffer buffer=new StringBuffer();
  for (int i=0; i < lines.length; i++) {
    if (i > 0)     buffer.append(delimiter);
    buffer.append(lines[i]);
  }
  return buffer.toString();
}

public static String concatenate ( String [ ] lines , String delimiter ) { StringBuffer buffer = new StringBuffer ( ) ; for ( int i = 0 ; i < lines . length ; i ++ ) { if ( i > 0 ) buffer . append ( delimiter ) ; buffer . append ( lines [ i ] ) ; } return buffer . toString ( ) ; }
concatenate the given strings into one strings using the passed line delimiter as a delimiter . no delimiter is added to the last line .
