MCPcopy Create free account
hub / github.com/davidgiven/luje / compareToIgnoreCase

Method compareToIgnoreCase

lib/java/lang/String.java:635–651  ·  view source on GitHub ↗

Compares the specified string to this string using the Unicode values of the characters, ignoring case differences. Returns 0 if the strings contain the same characters in the same order. Returns a negative integer if the first non-equal character in this string has a Unicode value which is less tha

(String string)

Source from the content-addressed store, hash-verified

633 * if {@code string} is {@code null}.
634 */
635 public int compareToIgnoreCase(String string) {
636 int o1 = offset, o2 = string.offset, result;
637 int end = offset + (count < string.count ? count : string.count);
638 char c1, c2;
639 char[] target = string.value;
640 while (o1 < end) {
641 if ((c1 = value[o1++]) == (c2 = target[o2++])) {
642 continue;
643 }
644 c1 = compareValue(c1);
645 c2 = compareValue(c2);
646 if ((result = c1 - c2) != 0) {
647 return result;
648 }
649 }
650 return count - string.count;
651 }
652
653 /**
654 * Concatenates this string and the specified string.

Callers 4

compareMethod · 0.80
compareToMethod · 0.80
compareToMethod · 0.80
compareToMethod · 0.80

Calls 1

compareValueMethod · 0.95

Tested by

no test coverage detected