diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | string.c | 12 | ||||
-rw-r--r-- | version.h | 2 |
3 files changed, 14 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Fri Jun 30 20:31:59 2017 Marcus Stollsteimer <[email protected]> + + * string.c: [DOC] clarify docs for String#split when called with limit + and capture groups. Reported by Cichol Tsai. [Bug #13621] + Fri Jun 30 20:23:31 2017 Takashi Kokubun <[email protected]> * lib/erb.rb: Allow explicit trimming carriage return when trim_mode is @@ -6769,7 +6769,7 @@ static const char isspacetable[256] = { /* * call-seq: - * str.split(pattern=nil, [limit]) -> anArray + * str.split(pattern=nil, [limit]) -> an_array * * Divides <i>str</i> into substrings based on a delimiter, returning an array * of these substrings. @@ -6789,9 +6789,11 @@ static const char isspacetable[256] = { * split on whitespace as if ` ' were specified. * * If the <i>limit</i> parameter is omitted, trailing null fields are - * suppressed. If <i>limit</i> is a positive number, at most that number of - * fields will be returned (if <i>limit</i> is <code>1</code>, the entire - * string is returned as the only entry in an array). If negative, there is no + * suppressed. If <i>limit</i> is a positive number, at most that number + * of split substrings will be returned (captured groups will be returned + * as well, but are not counted towards the limit). + * If <i>limit</i> is <code>1</code>, the entire + * string is returned as the only entry in an array. If negative, there is no * limit to the number of fields returned, and trailing null fields are not * suppressed. * @@ -6811,6 +6813,8 @@ static const char isspacetable[256] = { * "1,2,,3,4,,".split(',', 4) #=> ["1", "2", "", "3,4,,"] * "1,2,,3,4,,".split(',', -4) #=> ["1", "2", "", "3", "4", "", ""] * + * "1:2:3".split(/(:)()()/, 2) #=> ["1", ":", "", "", "2:3"] + * * "".split(',', -1) #=> [] */ @@ -1,6 +1,6 @@ #define RUBY_VERSION "2.3.5" #define RUBY_RELEASE_DATE "2017-06-30" -#define RUBY_PATCHLEVEL 323 +#define RUBY_PATCHLEVEL 324 #define RUBY_RELEASE_YEAR 2017 #define RUBY_RELEASE_MONTH 6 |