Compares the specified string to this string ignoring the case of the characters and returns true if they are equal. @param string the string to compare. @return true if the specified string is equal to this string, false otherwise.
(String string)
| 790 | * {@code false} otherwise. |
| 791 | */ |
| 792 | public boolean equalsIgnoreCase(String string) { |
| 793 | if (string == this) { |
| 794 | return true; |
| 795 | } |
| 796 | if (string == null || count != string.count) { |
| 797 | return false; |
| 798 | } |
| 799 | |
| 800 | int o1 = offset, o2 = string.offset; |
| 801 | int end = offset + count; |
| 802 | char c1, c2; |
| 803 | char[] target = string.value; |
| 804 | while (o1 < end) { |
| 805 | if ((c1 = value[o1++]) != (c2 = target[o2++]) |
| 806 | && toUpperCase(c1) != toUpperCase(c2) |
| 807 | // Required for unicode that we test both cases |
| 808 | && toLowerCase(c1) != toLowerCase(c2)) { |
| 809 | return false; |
| 810 | } |
| 811 | } |
| 812 | return true; |
| 813 | } |
| 814 | |
| 815 | /** |
| 816 | * Converts this string to a byte array using the default encoding as |
no test coverage detected