Skip to content

Instantly share code, notes, and snippets.

@plioi
Created May 23, 2012 01:19
Show Gist options
  • Save plioi/2772714 to your computer and use it in GitHub Desktop.
Save plioi/2772714 to your computer and use it in GitHub Desktop.
int[] digits = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
int[] firstFive = digits[0:5]
int[] lastFive = digits[5:10]
int[] interiorFive = digits[3:8]
firstFive.Append(100) // Equals [0, 1, 3, 4, 100]
interiorFive.With(2, 100) // Equals [3, 4, 100, 6, 7]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment