Skip to content

Instantly share code, notes, and snippets.

@krzyzanowskim
Last active October 24, 2015 21:56
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/e049b278c9e84639fe22 to your computer and use it in GitHub Desktop.
Save krzyzanowskim/e049b278c9e84639fe22 to your computer and use it in GitHub Desktop.
// define array of Int
var array:[Int] = [1,2,3,4,5]
// In fact Slice is returned, not Array
// [2,3,4]
var subslice:Slice<[Int]> = Slice(base: array, bounds: Range<Int>(start: 1, end: 4))
// For Sub Array, you need to create array with slice
var subarray:[Int] = Array(subslice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment