Method: Array#delete_at

Defined in:
array.c

#delete_at(index) ⇒ Object?

Deletes the element at the specified index, returning that element, or nil if the index is out of range. See also Array#slice!.

a = %w( ant bat cat dog )
a.delete_at(2)    #=> "cat"
a                 #=> ["ant", "bat", "dog"]
a.delete_at(99)   #=> nil

Returns:



1921
1922
1923
# File 'array.c', line 1921

static VALUE
rb_ary_delete_at_m(ary, pos)
VALUE ary, pos;