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

Method escapeAndQuote

output/java_guava/1.4.16/MediaType.java:1073–1083  ·  view source on GitHub ↗
(String value)

Source from the content-addressed store, hash-verified

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

Callers 1

applyMethod · 0.95

Calls 3

toStringMethod · 0.65
appendMethod · 0.45
lengthMethod · 0.45

Tested by

no test coverage detected