public UTF8String toLowerCase ( ) { if ( numBytes == 0 ) { return EMPTY_UTF8 ; } byte [ ] bytes = new byte [ numBytes ] ; bytes [ 0 ] = ( byte ) Character . toTitleCase ( getByte ( 0 ) ) ; for ( int i = 0 ; i < numBytes ; i ++ ) { byte b = getByte ( i ) ; if ( numBytesForFirstByte ( b ) != 1 ) { // fallback return toLowerCaseSlow ( ) ; } int lower = Character . toLowerCase ( ( int ) b ) ; if ( lower > 127 ) { // fallback return toLowerCaseSlow ( ) ; } bytes [ i ] = ( byte ) lower ; } return fromBytes ( bytes ) ; }
Returns the lower case of this string