るりまサーチ

最速Rubyリファレンスマニュアル検索!
59件ヒット [1-59件を表示] (0.134秒)
トップページ > クエリ:i[x] > クエリ:h[x] > クエリ:drop_while[x]

別のキーワード

  1. _builtin to_h
  2. env to_h
  3. hash to_h
  4. array to_h
  5. ostruct to_h

ライブラリ

クラス

モジュール

検索結果

Enumerator::Lazy#drop_while {|item| ... } -> Enumerator::Lazy (30365.0)

Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

...Enumerable#drop_while と同じですが、配列ではなくEnumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.drop_while { |i| i < 42 }
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 1:step>>:drop_while>

1.step.lazy.drop_while { |i| i < 42 }.take(10).force
# => [42...
..., 43, 44, 45, 46, 47, 48, 49, 50, 51]
//}

@see Enumerable#drop_while...

Array#drop_while -> Enumerator (30326.0)

ブロックを評価して最初に偽となった要素の手前の要素まで捨て、 残りの要素を配列として返します。 このメソッドは自身を破壊的に変更しません。

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

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

# 変数aの値は変化しない
a # => [1, 2, 3, 4, 5, 0]
//}

@see Enumerable#drop_while, Array#drop...

Array#drop_while {|element| ... } -> Array (30326.0)

ブロックを評価して最初に偽となった要素の手前の要素まで捨て、 残りの要素を配列として返します。 このメソッドは自身を破壊的に変更しません。

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

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

# 変数aの値は変化しない
a # => [1, 2, 3, 4, 5, 0]
//}

@see Enumerable#drop_while, Array#drop...

Enumerable#drop_while -> Enumerator (30320.0)

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

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

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

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

Enumerable#drop_while {|element| ... } -> Array (30320.0)

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

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

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

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

絞り込み条件を変える

NEWS for Ruby 3.0.0 (24.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...positional arguments.
Code that resulted in deprecation warnings in Ruby 2.7 will now
result in ArgumentError or different behavior. 14183
* Procs accepting a single rest argument and keywords are no longer
subject to autosplatting. This now matches the behavior of Procs
accepting...
...single rest argument and no keywords.
16166

//emlist[][ruby]{
pr = proc{|*a, **kw| [a, kw]}

pr.call([1])
# 2.7 => [[1], {}]
# 3.0 => [[[1]], {}]

pr.call([1, {a: 1}])
# 2.7 => [[1], {:a=>1}] # and deprecation warning
# 3.0 => a=>1}, {}]
//}

* Arguments forwarding (`...`) now supports leadin...
...race-limit` option limits the maximum length of a backtrace.
8661

== Core classes updates

Outstanding ones only.

* Array
* The following methods now return Array instances instead of subclass instances when called on subclass instances: 6087
* Array#drop
* Array#drop_while...