RFR: 8305486: Add split() variants that keep the delimiters to String and j.u.r.Pattern [v2]
Raffaello Giulietti
rgiulietti at openjdk.org
Wed Apr 12 08:48:33 UTC 2023
On Tue, 11 Apr 2023 20:42:38 GMT, Roger Riggs <rriggs at openjdk.org> wrote:
>> The choice of multi-character delimiter is deliberate, to show that the regex really absorbs all the delimiter characters.
>> The `":+"` examples are followed by the `"o"` examples, where the delimiters are single characters.
>
> I understood the value of `:+` case.
> I found reading the single "o" as a delimiter is not intuitive or easy to parse because it looks like the the strings that are being delimited, not a delimiter.
The `"o"` examples are extended versions of the ones "inherited" from the existing `split(String,int)` variant.
I have no objections in replacing the examples with something else, but at some point there must be a less intuitive example to illustrate the full generality of the method.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/13305#discussion_r1163819102
More information about the core-libs-dev
mailing list