On Monday, 9 June 2014 at 10:14:40 UTC, bearophile wrote:
Chris:
auto word = "bla-bla";
auto parts = appender!(string[]);
w.splitter('-').copy(parts);
// parts.data.length == 3 ["bla", "", "bla"]
With the current dmd 2.066alpha this code:
void main() {
import std.stdio, std.string, std.algorithm;
const txt = "bla-bla";
txt.split("-").writeln;
txt.splitter("-").writeln;
txt.splitter('-').writeln;
}
Prints:
["bla", "bla"]
["bla", "bla"]
["bla", "bla"]
Bye,
bearophile
Ok, thanks. I'll keep that in mind for the next version.