summaryrefslogtreecommitdiff
path: root/rust/theBook/chapter-8-common-collections/string/src/main.rs
blob: c28e5b13f59a56d7267b1548c0dca773af670a83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
fn main() {
    let mut m = String::from("Hello");
    println!("{}",m);

    m.push_str(" World");
    println!("{}",m);

    let p = ", World";
    let l = m + &p;
    println!("{}",l);

    let z = "tic";
    let x = "tac";
    let c = "toe";

    let s = format!("{z}-{x}{c}");
    println!("{s}");
}