MCPcopy Create free account
hub / github.com/ReadyTalk/avian / compareToIgnoreCase

Method compareToIgnoreCase

classpath/java/lang/String.java:211–228  ·  view source on GitHub ↗
(String s)

Source from the content-addressed store, hash-verified

209 }
210
211 public int compareToIgnoreCase(String s) {
212 if (this == s) return 0;
213
214 int idx = 0;
215 int result;
216
217 int end = (length < s.length ? length : s.length);
218
219 while (idx < end) {
220 if ((result =
221 Character.toLowerCase(charAt(idx)) -
222 Character.toLowerCase(s.charAt(idx))) != 0) {
223 return result;
224 }
225 idx++;
226 }
227 return length - s.length;
228 }
229
230 public String trim() {
231 int start = -1;

Callers 2

equalsIgnoreCaseMethod · 0.95
compareMethod · 0.80

Calls 3

toLowerCaseMethod · 0.95
charAtMethod · 0.95
charAtMethod · 0.65

Tested by

no test coverage detected