public static String toLowerString ( String s ) { int len = s . length ( ) ; int idx = 0 ; for ( ; idx < len ; idx ++ ) { if ( isUpper ( s . charAt ( idx ) ) ) { break ; } } if ( idx == len ) { return s ; } char [ ] buf = new char [ len ] ; for ( int i = 0 ; i < len ; i ++ ) { char c = s . charAt ( i ) ; buf [ i ] = ( i < idx ) ? c : toLower ( c ) ; } return new String ( buf ) ; }
Converts the given ASCII String to lower - case .