drop_while

ary.drop_while { |arr| block } â new_ary
ary.drop_while â Enumerator
Instance Public methods

Drops elements up to, but not including, the first element for which the block returns nil or false and returns an array containing the remaining elements.

If no block is given, an Enumerator is returned instead.

See also #take_while

a = [1, 2, 3, 4, 5, 0]
a.drop_while {|i| i < 3 }   #=> [3, 4, 5, 0]
doc_ruby_on_rails
2015-03-30 16:31:13
Comments
Leave a Comment

Please login to continue.