- to_string
Create String from literal string using to_string
- ToString is a trait that can convert anything to a String.
examples/strings/to-string/src/main.rs
fn main() { let mut text = "abc".to_string(); println!("{text}"); text.push_str("efg"); println!("{text}"); }
abc abcefg