mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
string.c: [DOC] split with block [ci skip]
* string.c (rb_str_split_m): [DOC] about split with block. [Feature #4780] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b83ae7476e
commit
1bf9dec04c
1 changed files with 5 additions and 1 deletions
4
string.c
4
string.c
|
@ -7634,6 +7634,7 @@ split_string(VALUE result, VALUE str, long beg, long len, long empty_count)
|
||||||
/*
|
/*
|
||||||
* call-seq:
|
* 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
|
* Divides <i>str</i> into substrings based on a delimiter, returning an array
|
||||||
* of these substrings.
|
* of these substrings.
|
||||||
|
@ -7680,6 +7681,9 @@ split_string(VALUE result, VALUE str, long beg, long len, long empty_count)
|
||||||
* "1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"]
|
* "1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"]
|
||||||
*
|
*
|
||||||
* "".split(',', -1) #=> []
|
* "".split(',', -1) #=> []
|
||||||
|
*
|
||||||
|
* If a block is given, invoke the block with each split substrings.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue