Gestionnaire de fichiers - Editer - /opt/cpanel/ea-ruby24/root/usr/share/ri/system/String/scan-i.ri
Arrière
U:RDoc::AnyMethod[iI" scan:ETI"String#scan;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"QBoth forms iterate through <i>str</i>, matching the pattern (which may be a ;TI"P<code>Regexp</code> or a <code>String</code>). For each match, a result is ;TI"Ogenerated and either added to the result array or passed to the block. If ;TI"Lthe pattern contains no groups, each individual result consists of the ;TI"Lmatched string, <code>$&</code>. If the pattern contains groups, each ;TI"Iindividual result is itself an array containing one entry per group.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [ I"a = "cruel world" ;TI"1a.scan(/\w+/) #=> ["cruel", "world"] ;TI"4a.scan(/.../) #=> ["cru", "el ", "wor"] ;TI":a.scan(/(...)/) #=> [["cru"], ["el "], ["wor"]] ;TI";a.scan(/(..)(..)/) #=> [["cr", "ue"], ["l ", "wo"]] ;T:@format0o; ; [I"And the block form:;T@o;; [ I",a.scan(/\w+/) {|w| print "<<#{w}>> " } ;TI"print "\n" ;TI"*a.scan(/(.)(.)/) {|x,y| print y, x } ;TI"print "\n" ;T; 0o; ; [I"<em>produces:</em>;T@o;; [I"<<cruel>> <<world>> ;TI"rceu lowlr;T; 0: @fileI" string.c;T:0@omit_headings_from_table_of_contents_below0I"istr.scan(pattern) -> array str.scan(pattern) {|match, ...| block } -> str ;T0[ I" (p1);T@+FI"String;TcRDoc::NormalClassI" scanf;T0
| ver. 1.4 |
Github
|
.
| PHP 8.0.30 | Génération de la page: 0.01 |
proxy
|
phpinfo
|
Réglages