Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Last active October 24, 2015 22:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save krzyzanowskim/b9a369c2b1ef4f5b197f to your computer and use it in GitHub Desktop.
Save krzyzanowskim/b9a369c2b1ef4f5b197f to your computer and use it in GitHub Desktop.
// define array
var array:[Int] = [1,2,3,4,5]
// get a slice of array
let subslice = Slice(base: arr, bounds: Range<Int>(start: 1, end: 4))
// and update second element of array
array[1] = 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment