public static String toCamelCase ( String text , char separator , boolean strict ) { char [ ] chars = text . toCharArray ( ) ; int base = 0 , top = 0 ; while ( top < chars . length ) { while ( top < chars . length && chars [ top ] == separator ) { ++ top ; } if ( top < chars . length ) { chars [ base ++ ] = Character . toUpperCase ( chars [ top ++ ] ) ; } if ( strict ) { while ( top < chars . length && chars [ top ] != separator ) { chars [ base ++ ] = Character . toLowerCase ( chars [ top ++ ] ) ; } } else { while ( top < chars . length && chars [ top ] != separator ) { chars [ base ++ ] = chars [ top ++ ] ; } } } return new String ( chars , 0 , base ) ; }
Converts a word sequence into a single camel - case sequence .