public static String camelCase ( String name ) { StringBuilder builder = new StringBuilder ( ) ; String [ ] parts = CAMEL_CASE_DELIMITER . split ( name ) ; for ( String part : parts ) { if ( part . isEmpty ( ) ) { continue ; } builder . append ( capitalize ( part ) ) ; } return builder . toString ( ) ; }
Format a name as CamelCase . The name is split on non - alphabet non - numeric chars and joined with each part capitalized . This is also called PascalCase . There is in this instance no assumptions on the name itself other than it contains some alphabet characters . Any uppercase letters in the name will be kept as uppercase so that a CamelCase name will stay CamelCase through this call .