Skip to main content

json_string_literal

Function json_string_literal 

Source
pub fn json_string_literal(value: &str) -> String
Expand description

Encode a string as a JSON string literal.

The returned value includes the surrounding quotes and correctly escapes control characters so the result can be embedded directly into JSONL output.