MCPcopy Index your code
hub / github.com/google/gson / escapeJsonString

Method escapeJsonString

src/main/java/com/google/gson/Escaper.java:68–76  ·  view source on GitHub ↗
(CharSequence plainText)

Source from the content-addressed store, hash-verified

66 }
67
68 public String escapeJsonString(CharSequence plainText) {
69 StringBuilder escapedString = new StringBuilder(plainText.length() + 20);
70 try {
71 escapeJsonString(plainText, escapedString);
72 } catch (IOException e) {
73 throw new RuntimeException(e);
74 }
75 return escapedString.toString();
76 }
77
78 private void escapeJsonString(CharSequence plainText, StringBuilder out) throws IOException {
79 int pos = 0; // Index just past the last char in plainText written to out.

Calls 6

isControlCharacterMethod · 0.95
lengthMethod · 0.80
appendMethod · 0.80
toStringMethod · 0.45