public static String combineLines ( String [ ] lines , char separator ) { if ( lines == null || lines . length == 0 ) return "" ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i != lines . length ; ++ i ) { String line = lines [ i ] ; if ( i != 0 ) sb . append ( separator ) ; sb . append ( line ) ; } return sb . toString ( ) ; }
Combine the lines into a single string using the supplied separator as the delimiter .