- let
- mut
Literal string in a mutable variable can be replaced
- Use the mut keyword to mark a variable as mutable.
- That way we can replace the string...
examples/variables/mutable-string/src/main.rs
fn main() { let mut text = "Hello World!"; println!("{text}"); text = "Something else"; println!("{text}"); }
Hello World! Something else