Ruby slice to end of an array

It’s popular enough to be a Google-suggested search, but not popular enough to have a good result yet.

If you want to slice to the end of a Ruby array, and/or get the end of a Ruby array, what you want is

arr[1, -1] # -1 means all the rest of the array

2 Replies to “Ruby slice to end of an array”

Leave a Reply

Your email address will not be published. Required fields are marked *