るりまサーチ

最速Rubyリファレンスマニュアル検索!
3件ヒット [1-3件を表示] (0.015秒)

別のキーワード

  1. _builtin compact
  2. _builtin compact!
  3. array compact
  4. array compact!
  5. pretty compact

ライブラリ

検索結果

Enumerable#compact -> Array (18114.0)

self から nil を取り除いた配列を生成して返します。

...self から nil を取り除いた配列を生成して返します。

//emlist[][ruby]{
def with_nils
yield 1
yield 2
yield nil
yield 3
end

to_enum(:with_nils).compact # => [1, 2, 3]
//}

@see Array#compact...