I have an array with let\'s say, 500 elements. I know I can select the first 100 by doing .first(100), my question is how do I select elements from 100 to 200?
.first(100)
sample_array = (1..500).to_a elements_100_to_200 = sample_array[100..200]
You can pass a range as index to an array and get a subarray with the queried elements from that subrange.