Skip to content

Instantly share code, notes, and snippets.

@ghazel
Created March 18, 2011 05:10
Show Gist options
  • Save ghazel/875650 to your computer and use it in GitHub Desktop.
Save ghazel/875650 to your computer and use it in GitHub Desktop.
irb(main):001:0> a = [1,2,3,4,5]
=> [1, 2, 3, 4, 5]
irb(main):002:0> a[0..3-1]
=> [1, 2, 3]
irb(main):003:0> a[0,3]
=> [1, 2, 3]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment