Why does Rust have String and str? What are the differences between String and str? When does one use String
String
str
For C# and Java people:
StringBuilder
&str
I like to think of a &str as a view on a string, like an interned string in Java / C# where you can't change it, only create a new one.