[Issue 20184] New: String maxsplit
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Aug 31 16:17:43 UTC 2019
https://issues.dlang.org/show_bug.cgi?id=20184
Issue ID: 20184
Summary: String maxsplit
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: svnpenn at gmail.com
D seems to have no way to limit the number of splits done on a string. This is
possible with Go:
strings.SplitN("one two three", " ", 2)
also Nim:
"one two three".split(maxsplit = 1)
also Python:
'one two three'.split(maxsplit = 1)
also PHP:
explode(' ', 'one two three', 2);
also Ruby:
'one two three'.split(nil, 2)
--
More information about the Digitalmars-d-bugs
mailing list