add String type
This commit is contained in:
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user