Does something like std.algorithm.iteration:splitter with multiple seperators exist?
ParticlePeter via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Mar 23 04:57:49 PDT 2016
I need to parse an ascii with multiple tokens. The tokens can be
seen as keys. After every token there is a bunch of lines
belonging to that token, the values.
The order of tokens is unknown.
I would like to read the file in as a whole string, and split the
string with:
splitter(fileString, [token1, token2, ... tokenN]);
And would like to get a range of strings each starting with
tokenX and ending before the next token.
Does something like this exist?
I know how to parse the string line by line and create new
strings and append the appropriate lines, but I don't know how to
do this with a lazy result range and new allocations.
More information about the Digitalmars-d-learn
mailing list