public static String unCamelify ( CharSequence original ) { StringBuilder result = new StringBuilder ( original . length ( ) ) ; boolean wasLowercase = false ; for ( int i = 0 ; i < original . length ( ) ; i ++ ) { char ch = original . charAt ( i ) ; if ( Character . isUpperCase ( ch ) && wasLowercase ) { result . append ( ' ' ) ; } wasLowercase = Character . isLowerCase ( ch ) ; result . append ( Character . toLowerCase ( ch ) ) ; } return result . toString ( ) ; }
Turn CamelCaseText into gnu - style - lowercase .