Marco Leise:

Not at all, the documentation explicitly states:

assert(equal(splitter("hello world", ' '), [ "hello", "", "world" ]));

I didn't see the ' ' in the OP code, sorry.

A test:


void main() {
    import std.stdio, std.string, std.algorithm;
    auto s = "hello  world";
    s.split().writeln;
    std.array.splitter(s).writeln;
    s.splitter(' ').writeln;
}


The output seems OK:

["hello", "world"]
["hello", "world"]
["hello", "", "world"]

Bye,
bearophile

Reply via email to