ary.keep_if { |item| block } â ary
ary.keep_if â Enumerator
ary.keep_if â Enumerator
Instance Public methods
Deletes every element of self
for which the given block
evaluates to false
.
See also #select!
If no block is given, an Enumerator is returned instead.
a = %w{ a b c d e f } a.keep_if { |v| v =~ /[aeiou]/ } #=> ["a", "e"]
Please login to continue.