String (Locale loc) { // First, see if the current string is already lower case. boolean turkish = "tr".equals(loc.getLanguage()); int i = count; int x = offset - 1; while (--i >= 0) { char ch = value[++x]; if ((turkish && ch == '\u0049') || ch != Character.toLowerCase(ch)) break; } if (i < 0) return this; // Now we perform the conversion. Fortunately, there are no multi-character // lowercase expansions in Unicode 3.0.0. char[] newStr = (char[]) value.clone(); do { char ch = value[x]; // Hardcoded special case. newStr[x++] = (turkish && ch == '\u0049') ? '\u0131' : Character.toLowerCase(ch); } while (--i >= 0); // Package constructor avoids an array copy. return new String(newStr, offset, count, true); }