Strings In Depth10 / 18
Up next

Concatenate with +

fn main() {
    let a = String::from("foo");
    let b = "bar";
    // + takes ownership of `a` and borrows the right side
    let joined = a + b;
    println!("{joined}");
}
What you're solving

+ consumes the left String