- push_str
Mutable string
- If we initialize the varibale using String::from and make it mutable then we can change the string.
examples/ownership/mutable-string/src/main.rs
fn main() { let mut name = String::from("Foo"); println!("{name}"); name.push_str(" Bar"); println!("{name}"); }
Foo Foo Bar