るりまサーチ

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

別のキーワード

  1. _builtin to_a
  2. matrix to_a
  3. to_a
  4. dbm to_a
  5. argf.class to_a

ライブラリ

クラス

モジュール

キーワード

検索結果

Enumerator::Lazy#grep_v(pattern) {|item| ... } -> Enumerator::Lazy (21441.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep_v(/(\d).*\1/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep_v(/(\d).*\1/)>
(100..Float::INFINITY).laz...
...y.map(&:to_s).grep_v(/(\d).*\1/).take(15).force
# => ["102", "103", "104", "105", "106", "107", "108", "109", "120", "123", "124", "125", "126", "127", "128"]
//}

@see Enumerable#grep_v, Enumerable#grep, Enumerator::Lazy#grep...

Enumerable#grep_v(pattern) { |item| ... } -> [object] (21314.0)

Enumerable#grep のマッチの条件を逆にして、pattern === item が成立 しない要素を全て含んだ配列を返します。

...Enumerable#grep のマッチの条件を逆にして、pattern === item が成立
しない要素を全て含んだ配列を返します。

@param pattern 「===」メソッドを持つオブジェクトを指定します。

//emlist[例][ruby]{
(1..10).grep_v 2..5 # => [1, 6, 7, 8, 9, 10]
res...
...=(1..10).grep_v(2..5) { |v| v * 2 }
res # => [2, 12, 14, 16, 18, 20]
//}

@see Enumerable#grep
@see Enumerable#reject...

Enumerator::Lazy#grep(pattern) {|item| ... } -> Enumerator::Lazy (3330.0)

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

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

//emlist[例][ruby]{
(100..Float::INFINITY).lazy.map(&:to_s).grep(/\A(\d)\1+\z/)
# => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator::Lazy: 100..Infinity>:map>:grep(/\A(\d)\1+\z/)>
(100..Float::INFINITY).laz...
...y.map(&:to_s).grep(/\A(\d)\1+\z/).take(10).force
# => ["111", "222", "333", "444", "555", "666", "777", "888", "999", "1111"]
//}

@see Enumerable#grep, Enumerable#grep_v, Enumerator::Lazy#grep_v...

Enumerable#grep(pattern) {|item| ... } -> [object] (3206.0)

pattern === item が成立する要素を全て含んだ配列を返します。

...pattern === item が成立する要素を全て含んだ配列を返します。

ブロックとともに呼び出された時には条件の成立した要素に対して
それぞれブロックを評価し、その結果の配列を返します。
マッチする要素がひとつもなかっ...
...返します。

@param pattern 「===」メソッドを持つオブジェクトを指定します。

//emlist[例][ruby]{
['aa', 'bb', 'cc', 'dd', 'ee'].grep(/[bc]/) # => ["bb", "cc"]

A
rray.instance_methods.grep(/gr/) # => [:grep, :group_by]
//}

@see Enumerable#select
@see Enumerable#grep_v...

Array#reject -> Enumerator (3118.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject
@see Enumerable#grep_v...

絞り込み条件を変える

Array#reject {|item| ... } -> [object] (3118.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
[1, 2, 3, 4, 5, 6].reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Array#select, Enumerable#reject
@see Enumerable#grep_v...

Enumerable#reject -> Enumerator (3118.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...ます。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Enumerable#select, Array#reject
@see Enumerable#grep_v...

Enumerable#reject {|item| ... } -> [object] (3118.0)

各要素に対してブロックを評価し、 その値が偽であった要素を集めた新しい配列を返します。 条件を反転させた select です。

...ます。
条件を反転させた select です。

ブロックを省略した場合は Enumerator を返します。

//emlist[例][ruby]{
# 偶数を除外する (奇数を集める)
(1..6).reject {|i| i % 2 == 0 } # => [1, 3, 5]
//}

@see Enumerable#select, Array#reject
@see Enumerable#grep_v...

NEWS for Ruby 3.0.0 (474.0)

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

...word arguments are now separated from 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 match...
...havior of Procs
a
ccepting a 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 forwar...
...lambda's arity check.
* When writing to STDOUT redirected to a closed pipe, no broken pipe error message will be shown now. 14413
* `TRUE`/`FALSE`/`NIL` constants are no longer defined.
* Integer#zero? overrides Numeric#zero? for optimization. 16961
* Enumerable#grep and Enumerable#grep_v...