std.algorithm.splitter request
Jack Stouffer via Digitalmars-d
digitalmars-d at puremagic.com
Mon Jul 18 08:46:56 PDT 2016
On Monday, 18 July 2016 at 09:01:43 UTC, Manu wrote:
> I want a version of splitter that doesn't eat the sentinels.
> I want to split AT the sentinels, but the sentinel should be
> the first element of the bucket.
>
> eg: assert(equal(splitter("hello world", ' '), [ "hello", " ",
> " world" ]));
>
> Note the weird behaviour since there are 2 spaces. More useful
> when the data is not strings.
I recently added this feature to std.regex.splitter:
https://github.com/dlang/phobos/pull/4174
Should be in the nightlies.
More information about the Digitalmars-d
mailing list