public static String capitalize ( String s ) { if ( s == null || s . length ( ) == 0 ) { return s ; } char chars [ ] = s . toCharArray ( ) ; chars [ 0 ] = Character . toUpperCase ( chars [ 0 ] ) ; return new String ( chars ) ; }
Small helper method to capitalize the first character of the given string .