fn main() {
  // 切片
  let s = String::from("Hello world");
  let substr = &s[1..6];
  let hello = &s[..5];
  let world = &s[6..];
  let whole = &s[..];
  println!("subtr: {}", substr);
  println!("hello: {}", hello);
  println!("world: {}", world);
  println!("whole: {}", whole);
}