delete_at

ary.delete_at(index) â obj or nil
Instance Public methods

Deletes the element at the specified index, returning that element, or nil if the index is out of range.

See also #slice!

a = ["ant", "bat", "cat", "dog"]
a.delete_at(2)    #=> "cat"
a                 #=> ["ant", "bat", "dog"]
a.delete_at(99)   #=> nil
doc_ruby_on_rails
2015-03-30 16:21:40
Comments
Leave a Comment

Please login to continue.