slice

    let mut a = [0u8, 1u8, 2u8, 3u8, 4u8, 5u8, 6u8, 7u8];
    println!("{:?}", &a[2 .. 4]);

输出:

[2, 3]
Comments
Write a Comment