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)
| 443 | */ |
| 444 | |
| 445 | public static String toLowerCase(String string) { |
| 446 | int length = string.length(); |
| 447 | for (int i = 0; i < length; i++) { |
| 448 | if (isUpperCase(string.charAt(i))) { |
| 449 | char[] chars = string.toCharArray(); |
| 450 | for (; i < length; i++) { |
| 451 | char c = chars[i]; |
| 452 | if (isUpperCase(c)) { |
| 453 | chars[i] = (char) (c ^ 0x20); |
| 454 | } |
| 455 | } |
| 456 | return String.valueOf(chars); |
| 457 | } |
| 458 | } |
| 459 | return string; |
| 460 | } |
| 461 | |
| 462 | /** |
| 463 | * Returns a copy of the input character sequence in which all {@linkplain #isUpperCase(char) |
no test coverage detected