I want to process a string containing a backslash followed by an escapable character as if they were one character.
let raw = r#"\""#;
let cooked = raw.process_escape_character_magic();
Right now, raw has 2 characters: \ and ". But what I actually want is cooked, which only has one character: ".
How do I get cooked?
I was thinking about using regex, but I feel like there should probably be a better way.