Am Sat, 14 Dec 2013 18:20:13 +0100 schrieb "bearophile" <bearophileh...@lycos.com>:
> 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 Somehow I cannot say this makes me happy. I totally thought there was only one splitter and it has to be used with a delimiter. You are right that the OP didn't say which version he used. The result made it clear in the end. So the solution to this is "use the other splitter". -- Marco