let a = vec![14, 12, 7, 42, 8]; // With a start and an end, here from 1 to 4 println!("{:?}", &a[1..4]); // With a start and an end, inclusive println!("{:?}", &a[1..=3]); // With just a start, from 2 to the end println!("{:?}", &a[2..]); // With just an end, from the start to 3 println!("{:?}", &a[..3]); // With just an end, inclusive println!("{:?}", &a[..=2]); // All elements println!("{:?}", &a[..]);