method

drop_while

v1_8_7_330 - Show latest stable - Class: Enumerable
drop_while()
public

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.

a = [1, 2, 3, 4, 5, 0]
a.drop_while {|i| i < 3 }   # => [3, 4, 5, 0]

1Note

Video Explanation of drop_while

MattStopa ยท Mar 11, 2012