fn main() { let s = String::from("hello world"); let hello = &s[0..5]; // 从索引 0 开始,到 5 之前结束 let world = &s[6..11]; println!("{} {}", hello, world); }