ruby-changes:50630
From: nobu <ko1@a...>
Date: Sat, 17 Mar 2018 13:13:31 +0900 (JST)
Subject: [ruby-changes:50630] nobu:r62790 (trunk): string.c: [DOC] split with block [ci skip]
nobu 2018-03-17 13:13:26 +0900 (Sat, 17 Mar 2018) New Revision: 62790 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62790 Log: string.c: [DOC] split with block [ci skip] * string.c (rb_str_split_m): [DOC] about split with block. [Feature #4780] Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 62789) +++ string.c (revision 62790) @@ -7633,7 +7633,8 @@ split_string(VALUE result, VALUE str, lo https://github.com/ruby/ruby/blob/trunk/string.c#L7633 /* * call-seq: - * str.split(pattern=nil, [limit]) -> an_array + * str.split(pattern=nil, [limit]) -> an_array + * str.split(pattern=nil, [limit]) {|sub| block } -> str * * Divides <i>str</i> into substrings based on a delimiter, returning an array * of these substrings. @@ -7680,6 +7681,9 @@ split_string(VALUE result, VALUE str, lo https://github.com/ruby/ruby/blob/trunk/string.c#L7681 * "1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"] * * "".split(',', -1) #=> [] + * + * If a block is given, invoke the block with each split substrings. + * */ static VALUE -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/