Ruby 2.2.0 リファレンスマニュアル > ライブラリ一覧 > 組み込みライブラリ > Enumerableモジュール > drop_while

instance method Enumerable#drop_while

drop_while -> Enumerator[permalink][rdoc]
drop_while {|element| ... } -> Array

ブロックを評価して最初に偽となった要素の手前の要素まで捨て、 残りの要素を配列として返します。

ブロックを指定しなかった場合は、Enumerator を返します。

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