public static String firstPartOfCamelCase ( String camelcased ) { // by starting to count before the isUpperCase-check, // we do not care if the strings starts with a lower- or uppercase int end = 0 ; while ( ++ end < camelcased . length ( ) ) { if ( Character . isUpperCase ( camelcased . charAt ( end ) ) ) break ; } return camelcased . substring ( 0 , end ) ; }
Extracts the first part of a camel_cased string .