drop

ary.drop(n) â new_ary
Instance Public methods

Drops first n elements from ary and returns the rest of the elements in an array.

If a negative number is given, raises an ArgumentError.

See also #take

1
2
a = [1, 2, 3, 4, 5, 0]
a.drop(3)             #=> [4, 5, 0]
doc_ruby_on_rails
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.