writeJSONString

fnvoid writeJSONString(Sink)(scope const(char)[] s, ref Sink sink, const bool asciiOnly = false, const char quote = '"') if (is(typeof(sink.put("test"))) || is(typeof(sink.put('c')))) @safe

Write a JSON/JSON5 string literal (including surrounding quotes) to sink.

Parameters

sUTF-8 bytes to write.
sinkOutput sink with put overloads.
asciiOnlyWhen true, escape non-ASCII code points.
quoteQuote character to use.