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

Method escapeAndQuote

output/java_guava/1.4.19/MediaType.java:1074–1084  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

1072 }
1073
1074 private static String escapeAndQuote(String value) {
1075 StringBuilder escaped = new StringBuilder(value.length() + 16).append('"');
1076 for (int i = 0; i < value.length(); i++) {
1077 char ch = value.charAt(i);
1078 if (ch == '\r' || ch == '\\' || ch == '"') {
1079 escaped.append('\\');
1080 }
1081 escaped.append(ch);
1082 }
1083 return escaped.append('"').toString();
1084 }
1085}

Callers 1

applyMethod · 0.95

Calls 3

toStringMethod · 0.65
appendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected