aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-17 04:13:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-03-17 04:13:26 +0000
commit348d4c269831b683c11b4c9da02acbab5128a6cb (patch)
tree8cfe562b632b1c77ade0b0c0f49406e16954a825 /string.c
parent86ed7c39f26dc92876b581fd73a6209086001bfb (diff)
downloadruby-348d4c269831b683c11b4c9da02acbab5128a6cb.tar.gz
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
Diffstat (limited to 'string.c')
-rw-r--r--string.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/string.c b/string.c
index 01b5c4e421..ebac5e043d 100644
--- a/string.c
+++ b/string.c
@@ -7633,7 +7633,8 @@ split_string(VALUE result, VALUE str, long beg, long len, long empty_count)
/*
* 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, long beg, long len, long empty_count)
* "1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"]
*
* "".split(',', -1) #=> []
+ *
+ * If a block is given, invoke the block with each split substrings.
+ *
*/
static VALUE