In Ruby the first index is the start location and the second holds the count: array[start, count].
array = ["Hello", "there", "AAA", 1, 2, 3]
array[1] = "here"
p array
array = ["Hello", "there", "AAA", 1, 2, 3]
array[1, 1] = "here"
p array
Related examples in the same category