* string.c (rb_str_split_m): Documented behavior of split on the empty
string. [ruby-trunk - Feature #3575] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
830ff445f9
commit
e5c418d991
@ -1,3 +1,8 @@
|
|||||||
|
Tue Apr 10 09:57:00 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
|
* string.c (rb_str_split_m): Documented behavior of split on the empty
|
||||||
|
string. [ruby-trunk - Feature #3575]
|
||||||
|
|
||||||
Tue Apr 10 09:48:31 2012 Eric Hodel <drbrain@segment7.net>
|
Tue Apr 10 09:48:31 2012 Eric Hodel <drbrain@segment7.net>
|
||||||
|
|
||||||
* ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
|
* ext/zlib/zlib.c (rb_deflate_s_deflate): Fixed ruby example replacing
|
||||||
|
5
string.c
5
string.c
@ -5742,6 +5742,9 @@ static const char isspacetable[256] = {
|
|||||||
* limit to the number of fields returned, and trailing null fields are not
|
* limit to the number of fields returned, and trailing null fields are not
|
||||||
* suppressed.
|
* suppressed.
|
||||||
*
|
*
|
||||||
|
* When the input +str+ is empty an empty Array is returned as the string is
|
||||||
|
* considered to have no fields to split.
|
||||||
|
*
|
||||||
* " now's the time".split #=> ["now's", "the", "time"]
|
* " now's the time".split #=> ["now's", "the", "time"]
|
||||||
* " now's the time".split(' ') #=> ["now's", "the", "time"]
|
* " now's the time".split(' ') #=> ["now's", "the", "time"]
|
||||||
* " now's the time".split(/ /) #=> ["", "now's", "", "the", "time"]
|
* " now's the time".split(/ /) #=> ["", "now's", "", "the", "time"]
|
||||||
@ -5754,6 +5757,8 @@ static const char isspacetable[256] = {
|
|||||||
* "1,2,,3,4,,".split(',') #=> ["1", "2", "", "3", "4"]
|
* "1,2,,3,4,,".split(',') #=> ["1", "2", "", "3", "4"]
|
||||||
* "1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"]
|
* "1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"]
|
||||||
* "1,2,,3,4,,".split(',', -4) #=> ["1", "2", "", "3", "4", "", ""]
|
* "1,2,,3,4,,".split(',', -4) #=> ["1", "2", "", "3", "4", "", ""]
|
||||||
|
*
|
||||||
|
* "".split(',', -1) #=> []
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user