pub fn escape_double_quotes(string: &str) -> Cow<'_, String, str>Expand description
Replaces \ and " in string with (repectively) \\ and \", as lazily as possible.
ยงExample
use cervine::Cow;
use lazy_transform_str::escape_double_quotes;
let input = r#"a "quoted" word"#;
let output = escape_double_quotes(input);
assert_eq!(output, Cow::Owned(r#"a \"quoted\" word"#.into()));