/enquote

A Rust library that quotes, unquotes, and unescapes strings

Primary LanguageRustThe UnlicenseUnlicense

enquote crate docs

This Rust library quotes, unquotes, and unescapes strings.

Example

extern crate enquote;

fn main() {
    assert_eq!(enquote::enquote('\'', "foo'bar"), "'foo\\'bar'");
    assert_eq!(enquote::unquote("'foo\\'bar\\n'").unwrap(), "foo'bar\n");
    assert_eq!(enquote::unescape("\\n", None).unwrap(), "\n");
}