json - The operator r#""# in Rust -
I saw operator r # ""
in the war but I do not know what it does . It was easy to make JSON:
let var1 = "test1"; Let json = r # "{" type ":" type1 "," type2 ": var1}" #; Println! ("{}", Json) // = & gt; {"Type 2": "Type 1", "Type2": var1}
what is the name of the operator r # ""
and how do I Var1
I do not know what it does
It is to do with string literals and raw strings. I think it has been explained very well, which is posted in the code block, you can see what it does:
"foo"; R "foo"; // foo "\" foo \ ""; R # "" foo "" #; // "foo" "Foo # \" #bar "; r ## "EFU #" #bar "##; // foo # "#bar" \ x52 ";" R "; r" r "; // r" \\ x52 "; r" \ x52 "; // \ x52
to avoid special characters inside this string Rejects the requirement.
Comments
Post a Comment