MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / foldCase

Method foldCase

vm/JavaAPI/src/java/lang/String.java:647–655  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.

Callers 1

regionMatchesMethod · 0.95

Calls 2

toLowerCaseMethod · 0.95
toUpperCaseMethod · 0.95

Tested by

no test coverage detected