MCPcopy Create free account
hub / github.com/antlr/codebuff / toUpperCase

Method toUpperCase

output/java_guava/1.4.13/Ascii.java:500–515  ·  view source on GitHub ↗

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

(String string)

Source from the content-addressed store, hash-verified

498
499
500 public static String toUpperCase(String string) {
501 int length = string.length();
502 for (int i = 0; i < length; i++) {
503 if (isLowerCase(string.charAt(i))) {
504 char[] chars = string.toCharArray();
505 for (; i < length; i++) {
506 char c = chars[i];
507 if (isLowerCase(c)) {
508 chars[i] = (char) (c & 0x5f);
509 }
510 }
511 return String.valueOf(chars);
512 }
513 }
514 return string;
515 }
516
517 /**
518 * Returns a copy of the input character sequence in which all {@linkplain #isLowerCase(char)

Callers 3

convertMethod · 0.95
normalizeWordMethod · 0.95
firstCharOnlyToUpperMethod · 0.95

Calls 6

isLowerCaseMethod · 0.95
toStringMethod · 0.65
lengthMethod · 0.45
toCharArrayMethod · 0.45
valueOfMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected