question: static private String toUpperCaseFast ( final String s ) { boolean different = false ; final int mx = s . length ( ) ; char [ ] chars = new char [ mx ] ; for ( int i = 0 ; i < mx ; i ++ ) { char ch = s . charAt ( i ) ; if ( 'a' <= ch && ch <= 'z' ) { ch = ( char ) ( ch + ( 'A' - 'a' ) ) ; different = true ; } chars [ i ] = ch ; } final String upper ; if ( different ) upper = String . valueOf ( chars ) ; else upper = s ; return upper ; }
target:  A fast and cheap way to uppercase a String that is only made of printable ASCII characters. <p> This is not a public API.