String — owned, mutable. &str — borrowed, immutable.
String:
1let mut s = String::from("hello");2s.push_str(" world");3println!("{}", s); // hello world
&str:
1let s = "hello"; // &str2let s2 = &String::from("hello"); // &str
Key differences: