private static String camelFormat ( String str , boolean isFirstCapitalized ) { StringBuilder builder = new StringBuilder ( str . length ( ) ) ; String [ ] tokens = NOT_ALPHANUMERIC_REGEX . split ( str ) ; for ( int i = 0 ; i < tokens . length ; i ++ ) { String lowerCased = StringUtils . lowerCase ( tokens [ i ] ) ; if ( i == 0 ) { builder . append ( isFirstCapitalized ? StringUtils . capitalize ( lowerCased ) : lowerCased ) ; } else { builder . append ( StringUtils . capitalize ( lowerCased ) ) ; } } return builder . toString ( ) ; }
Camel format string