public static String makePropertyName ( String name ) { char [ ] buf = new char [ name . length ( ) + 3 ] ; int pos = 0 ; buf [ pos ++ ] = ' ' ; buf [ pos ++ ] = ' ' ; buf [ pos ++ ] = ' ' ; for ( int ix = 0 ; ix < name . length ( ) ; ix ++ ) { char ch = name . charAt ( ix ) ; if ( ix == 0 ) ch = Character . toUpperCase ( ch ) ; else if ( ch == ' ' ) { ix ++ ; if ( ix == name . length ( ) ) break ; ch = Character . toUpperCase ( name . charAt ( ix ) ) ; } buf [ pos ++ ] = ch ; } return new String ( buf , 0 , pos ) ; }
public because it s used by other packages that use Duke