select() public

Invokes the block passing in successive elements from self, returning an array containing those elements for which the block returns a true value (equivalent to Enumerable#select).

If no block is given, an enumerator is returned instead.

a = %w{ a b c d e f } {|v| v =~ /[aeiou]/}   #=> ["a", "e"]
Show source
Register or log in to add new notes.