add String type

This commit is contained in:
Sil Klaasboer
2025-12-18 13:30:06 +01:00
parent ca2c8bdcc6
commit 2069c2d469

View File

@@ -11,6 +11,10 @@ fn main() {
let height: f64 = 1.79; let height: f64 = 1.79;
let character: char = 'M'; let character: char = 'M';
let has_driver_license: bool = true; let has_driver_license: bool = true;
let mut text = "Hello".to_string();
text.push_str(" World");
let text2 = String::from("Hello world2");
println!("{} {}",text,text2);
//make them mutable by mut modifier //make them mutable by mut modifier
let mut middle_name = "Levy"; let mut middle_name = "Levy";