Skip to main content

json_escape

Function json_escape 

Source
pub fn json_escape(input: &str) -> String
Expand description

Escape a string for safe inclusion inside a JSON string literal.

Escapes ", \\, the C0 control range (U+0000..=U+001F) and the common shorthand escapes. The result does not include the surrounding quotes.