MCPcopy
hub / github.com/google/guava / toLowerCase

Method toLowerCase

guava/src/com/google/common/base/Ascii.java:407–422  ·  view source on GitHub ↗

Returns a copy of the input string in which all {@linkplain #isUpperCase(char) uppercase ASCII characters} have been converted to lowercase. All other characters are copied without modification.

(String string)

Source from the content-addressed store, hash-verified

405 * modification.
406 */
407 public static String toLowerCase(String string) {
408 int length = string.length();
409 for (int i = 0; i < length; i++) {
410 if (isUpperCase(string.charAt(i))) {
411 char[] chars = string.toCharArray();
412 for (; i < length; i++) {
413 char c = chars[i];
414 if (isUpperCase(c)) {
415 chars[i] = (char) (c ^ CASE_MASK);
416 }
417 }
418 return String.valueOf(chars);
419 }
420 }
421 return string;
422 }
423
424 /**
425 * Returns a copy of the input character sequence in which all {@linkplain #isUpperCase(char)

Callers 15

toStringMethod · 0.95
toStringMethod · 0.95
lowerCaseMethod · 0.95
normalizeWordMethod · 0.95
normalizeFirstWordMethod · 0.95
convertMethod · 0.95
firstCharOnlyToUpperMethod · 0.95
MediaTypeClass · 0.95
normalizeTokenMethod · 0.95
InternetDomainNameMethod · 0.95
applyMethod · 0.95

Calls 5

isUpperCaseMethod · 0.95
lengthMethod · 0.45
charAtMethod · 0.45
toCharArrayMethod · 0.45
valueOfMethod · 0.45

Tested by 13

applyMethod · 0.76
transformEntryMethod · 0.76
testToLowerCaseMethod · 0.76
testCharsIgnoredMethod · 0.76
testCharsLowerMethod · 0.76
testCharsUpperMethod · 0.76
testToStringMethod · 0.76
upperToHttpHeaderNameMethod · 0.76
applyMethod · 0.36