D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Array
/
Filename :
select-i.ri
back
Copy
U:RDoc::AnyMethod[iI"select:ETI"Array#select;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"FWith a block given, calls the block with each element of +self+; ;TI"=returns a new array containing those elements of +self+ ;TI"0for which the block returns a truthy value:;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I" a = [:foo, 'bar', 2, :bam] ;TI"9a.select {|element| element.to_s.start_with?('b') } ;TI"# => ["bar", :bam] ;T:@format0o; ; [I"3With no block given, returns a new Enumerator.;T@o; ; [I"NRelated: see {Methods for Fetching}[rdoc-ref:Array@Methods+for+Fetching].;T: @fileI"array.c;T:0@omit_headings_from_table_of_contents_below0I"|select {|element| ... } -> new_array select -> new_enumerator filter {|element| ... } -> new_array filter -> new_enumerator ;T0[[I"filter;T@ [I"filter;To;; [ ;I" array.rb;T;0I"();T@FI" Array;TcRDoc::NormalClass00