Returns a copy of the input string in which all plain #isUpperCase(char) uppercase ASCII characters have been converted to lowercase. All other characters are copied without modification.
(String string)
| 404 | * modification. |
| 405 | */ |
| 406 | public static String toLowerCase(String string) { |
| 407 | int length = string.length(); |
| 408 | for (int i = 0; i < length; i++) { |
| 409 | if (isUpperCase(string.charAt(i))) { |
| 410 | char[] chars = string.toCharArray(); |
| 411 | for (; i < length; i++) { |
| 412 | char c = chars[i]; |
| 413 | if (isUpperCase(c)) { |
| 414 | chars[i] = (char) (c ^ 0x20); |
| 415 | } |
| 416 | } |
| 417 | return String.valueOf(chars); |
| 418 | } |
| 419 | } |
| 420 | return string; |
| 421 | } |
| 422 | |
| 423 | /** |
| 424 | * Returns a copy of the input character sequence in which all {@linkplain #isUpperCase(char) |
no test coverage detected