public static String capitalizeHeader ( String header ) { StringTokenizer st = new StringTokenizer ( header , "-" ) ; StringBuilder out = new StringBuilder ( ) ; while ( st . hasMoreTokens ( ) ) { String l = st . nextToken ( ) ; out . append ( Character . toUpperCase ( l . charAt ( 0 ) ) ) ; if ( l . length ( ) > 1 ) { out . append ( l . substring ( 1 ) ) ; } if ( st . hasMoreTokens ( ) ) out . append ( ' ' ) ; } return out . toString ( ) ; }
Fixes capitalization on headers