I wanna do this
let mystr = r#"
Id("#1#")
Id("#2#")
Id("#3#")
"#;
Which does not compile, since I need to somehow escape the "# and the #" occurences. but I don't know how to...
On
You can use an arbitrary number of hashes as string delimiters, as long as this number of hashes don't appear in the string itself. Like this:
let mystr = r##"
Id("#1#")
Id("#2#")
Id("#3#")
"##;
So, the problem with your approach is that your raw string contains sequence that is used for terminating raw string. What you need to do is add another
#on start and end of raw string. Like this:Notice second opening and closing
#.Output is:
You can check it out here on playground.
Check out docs, especially this part: