@@ -12,7 +12,7 @@ When +field_sep+ is <tt>$;</tt>:
1212 the split occurs just as if +field_sep+ were given as that string
1313 (see below).
1414
15- When +field_sep+ is <tt>' '</tt> and +limit+ is +nil+ ,
15+ When +field_sep+ is <tt>' '</tt> and +limit+ is +0+ (its default value) ,
1616the split occurs at each sequence of whitespace:
1717
1818 'abc def ghi'.split(' ') => ["abc", "def", "ghi"]
@@ -21,7 +21,7 @@ the split occurs at each sequence of whitespace:
2121 ''.split(' ') => []
2222
2323When +field_sep+ is a string different from <tt>' '</tt>
24- and +limit+ is +nil +,
24+ and +limit+ is +0 +,
2525the split occurs at each occurrence of +field_sep+;
2626trailing empty substrings are not returned:
2727
@@ -33,7 +33,7 @@ trailing empty substrings are not returned:
3333 'тест'.split('т') => ["", "ес"]
3434 'こんにちは'.split('に') => ["こん", "ちは"]
3535
36- When +field_sep+ is a Regexp and +limit+ is +nil +,
36+ When +field_sep+ is a Regexp and +limit+ is +0 +,
3737the split occurs at each occurrence of a match;
3838trailing empty substrings are not returned:
3939
@@ -47,12 +47,10 @@ in the returned array:
4747
4848 '1:2:3'.split(/(:)()()/, 2) # => ["1", ":", "", "", "2:3"]
4949
50- As seen above, if +limit+ is +nil+,
51- trailing empty substrings are not returned;
52- the same is true if +limit+ is zero:
50+ As seen above, if +limit+ is +0+,
51+ trailing empty substrings are not returned:
5352
5453 'aaabcdaaa'.split('a') => ["", "", "", "bcd"]
55- 'aaabcdaaa'.split('a', 0) # => ["", "", "", "bcd"]
5654
5755If +limit+ is positive integer +n+, no more than <tt>n - 1-</tt>
5856splits occur, so that at most +n+ substrings are returned,
@@ -67,7 +65,7 @@ and trailing empty substrings are included:
6765Note that if +field_sep+ is a \Regexp containing groups,
6866their matches are in the returned array, but do not count toward the limit.
6967
70- If +limit+ is negative, it behaves the same as if +limit+ was +nil+ ,
68+ If +limit+ is negative, it behaves the same as if +limit+ was zero ,
7169meaning that there is no limit,
7270and trailing empty substrings are included:
7371
0 commit comments