- String
- from
- push_str
Really mutable string
- We can create a really mutable string using the String::from function.
examples/variables/really-mutable-string/src/main.rs
fn main() { let mut name = String::from("Foo"); println!("{name}"); name.push_str(" Bar"); println!("{name}"); }
Foo Foo Bar