Some #Rust string literal #trivia - the following are equal:
let s = "one line string";
let s = "one line \
string";
And these ones are also equal:
let lines = "a\nmultiline\nstring";
let lines = "a
multiline
string";
and now my favorite... 🥁
let lines = "a\n\
multiline\n\
string";
Playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=a2c5a0e080a4fc56bb9ea8accac22a8b
[#]RustLang #RustTips #Strings
=> More informations about this toot | View the thread | More toots from janriemer@floss.social
=> View rust tag | View trivia tag | View rustlang tag | View rusttips tag | View strings tag This content has been proxied by September (3851b).Proxy Information
text/gemini