fn main() { let s = String::from("0123456789"); let s2 = &s[..]; let s3 = &s[2..5]; let s4 = &s[..5]; let s5 = &s[2..]; let s6 = &s[2..=5]; println!("s: {}", s); println!("s2: {}", s2); println!("s3: {}", s3); println!("s4: {}", s4); println!("s5: {}", s5); println!("s6: {}", s6); /* s: 0123456789 s2: 0123456789 s3: 234 s4: 01234 s5: 23456789 s6: 2345 */ }