Skip to content
Quiz · Borrowing · lesson 11 of 11

Quiz — string slices

What does the program print?

Rust
fn main() {
    let s = String::from("hello world");
    let a = &s[0..5];
    let b = &s[6..];
    println!("{b} {a}");
}