I have some strings with literal escape characters in them. I want to interpolate the string so that escaped characters are properly replaced (i.e. \n
is replaced with a newline, \t
is replaced with a tab, etc). Essentially I am looking for some_magic_function
in the example below
assert_eq!("foo\nbar", some_magic_function(r#"foo\nbar"#));
Does rust have something that can do this?