pub fn unescape(text: impl AsRef<str>) -> Result<String>
Expand description
Takes in a string with backslash escapes written out with literal backslash characters and converts it to a string with the proper escaped characters.
Escape | Unicode | Description |
---|---|---|
\b | \u{08} | Backspace |
\v | \u{0B} | Vertical tab |
\f | \u{0C} | Form feed |
\n | \u{0A} | Newline |
\r | \u{0D} | Carriage return |
\t | \u{09} | Tab |
\ | \u{5C} | Backslash |
' | \u{27} | Single quote |
" | \u{22} | Double quote |
$ | \u{24} | Dollar sign (sh compatibility) |
` | \u{60} | Backtick (sh compatibility) |
other | self | Just remove \ |