Project

General

Profile

Bug #9901 ยป 0001-Clarify-documentation-for-Array-insert.patch

ggilder (Gabriel Gilder), 06/04/2014 07:03 AM

View differences:

array.c
* Inserts the given values before the element with the given +index+.
*
* Negative indices count backwards from the end of the array, where +-1+ is
* the last element.
* the last element. If a negative index is used, the given values will be
* inserted after that element, so using an index of +-1+ will insert the
* values at the end of the array.
*
* a = %w{ a b c d }
* a.insert(2, 99) #=> ["a", "b", 99, "c", "d"]
    (1-1/1)