Should this work?

Adam D. Ruppe destructionator at gmail.com
Thu Jan 9 11:05:18 PST 2014


On Thursday, 9 January 2014 at 18:57:26 UTC, Craig Dillabaugh 
wrote:
> A while ago I was trying to do something with splitter on a 
> string and I ended up asking a question on D.learn. [...]
>
> It would be nice if std.string in D provided a nice, easy, 
> string manipulation that swept most of the difficulties under 
> the table

http://dlang.org/phobos/std_array.html#split

Note that std.array is publicly imported from std.string so this 
works:

void main() {
         import std.string;
         auto parts = "hello".split("l");

         import std.stdio;
         writeln(parts);
}


> provided links in the documentation to the functions they wrap 
> for when people want to do more complex things.

Actually, when writing my D book, I decided to spend more time on 
the unicode stuff in strings than these basic operations, since I 
thought these were pretty straightforward.

But maybe the docs suck more than I thought. I learned most of D 
string stuff from Phobos1 which kept it all simple...


More information about the Digitalmars-d mailing list