Last active
September 25, 2016 01:43
-
-
Save dumindu/0c95b62919fd7215238b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let a: [i32; 4] = [1, 2, 3, 4];//Parent Array | |
let b: &[i32] = &a; //Slicing whole array | |
let c = &a[0..4]; // From 0th position to 4th(excluding) | |
let d = &a[..]; //Slicing whole array | |
let e = &a[1..3]; //[2, 3] | |
let e = &a[1..]; //[2, 3, 4] | |
let e = &a[..3]; //[1, 2, 3] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment