MCPcopy Index your code
hub / github.com/processing/processing / quote

Method quote

core/src/processing/data/JSONObject.java:1390–1400  ·  view source on GitHub ↗

Produce a string in double quotes with backslash sequences in all the right places. A backslash will be inserted within </, producing <\/, allowing JSON text to be delivered in HTML. In JSON text, a string cannot contain a control character or an unescaped quote or backslash. @param string A String

(String string)

Source from the content-addressed store, hash-verified

1388 * @return A String correctly formatted for insertion in a JSON text.
1389 */
1390 static public String quote(String string) {
1391 StringWriter sw = new StringWriter();
1392 synchronized (sw.getBuffer()) {
1393 try {
1394 return quote(string, sw).toString();
1395 } catch (IOException ignored) {
1396 // will never happen - we are writing to a string writer
1397 return "";
1398 }
1399 }
1400 }
1401
1402 static public Writer quote(String string, Writer w) throws IOException {
1403 if (string == null || string.length() == 0) {

Callers 15

toJSONMethod · 0.95
toJSONMethod · 0.95
toJSONMethod · 0.95
toJSONMethod · 0.95
toJSONMethod · 0.95
toJSONMethod · 0.95
getMethod · 0.95
getStringMethod · 0.95
getIntMethod · 0.95
getLongMethod · 0.95
getDoubleMethod · 0.95
getBooleanMethod · 0.95

Calls 2

writeMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected