This isn't equivalent to either of ICU's u_foldCase case folds, and thus any of the Unicode case folds, but it's what the RI uses.
(char ch)
| 645 | * case folds, but it's what the RI uses. |
| 646 | */ |
| 647 | private char foldCase(char ch) { |
| 648 | if (ch < 128) { |
| 649 | if ('A' <= ch && ch <= 'Z') { |
| 650 | return (char) (ch + ('a' - 'A')); |
| 651 | } |
| 652 | return ch; |
| 653 | } |
| 654 | return Character.toLowerCase(Character.toUpperCase(ch)); |
| 655 | } |
| 656 | |
| 657 | /** |
| 658 | * Returns a new string resulting from replacing all occurrences of oldChar in this string with newChar. |
no test coverage detected