public static String joinStrings ( List < String > strings , boolean fixCase , char withChar ) { if ( strings == null || strings . size ( ) == 0 ) { return "" ; } StringBuilder result = null ; for ( String s : strings ) { if ( fixCase ) { s = fixCase ( s ) ; } if ( result == null ) { result = new StringBuilder ( s ) ; } else { result . append ( withChar ) ; result . append ( s ) ; } } return result . toString ( ) ; }
Generic string joining function .