unescape_c_str

Function unescape_c_str 

Source
pub fn unescape_c_str(s: &str) -> Result<String>
Expand description

Unescapes a string that has been escaped C-style.

This function parses common escape sequences (like \n, \t, ", \) as well as octal (\ooo) and hexadecimal (\xHH) escape notations.

§Arguments

  • s: The string slice containing C-style escape sequences.

§Returns

A Result<String> containing the new unescaped string. If an invalid escape sequence is encountered, an error is returned.