<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 10 January 2014 06:53, Craig Dillabaugh <span dir="ltr"><<a href="mailto:cdillaba@cg.scs.carleton.ca" target="_blank">cdillaba@cg.scs.carleton.ca</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Thursday, 9 January 2014 at 19:05:19 UTC, Adam D. Ruppe wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Thursday, 9 January 2014 at 18:57:26 UTC, Craig Dillabaugh wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
A while ago I was trying to do something with splitter on a string and I ended up asking a question on D.learn. [...]<br>
<br>
It would be nice if std.string in D provided a nice, easy, string manipulation that swept most of the difficulties under the table<br>
</blockquote>
<br>
<a href="http://dlang.org/phobos/std_array.html#split" target="_blank">http://dlang.org/phobos/std_<u></u>array.html#split</a><br>
<br>
Note that std.array is publicly imported from std.string so this works:<br>
<br>
void main() {<br>
        import std.string;<br>
        auto parts = "hello".split("l");<br>
<br>
        import std.stdio;<br>
        writeln(parts);<br>
}<br>
<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
provided links in the documentation to the functions they wrap for when people want to do more complex things.<br>
</blockquote>
<br>
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.<br>
<br>
But maybe the docs suck more than I thought. I learned most of D string stuff from Phobos1 which kept it all simple...<br>
</blockquote>
<br></div></div>
Thats the thing.  In most cases the correct way to do something in D, does end up being rather nice.  However, its often a bit of a challenge finding the that correct way!<br>
<br>
When I had my troubles I expected to find the library solutions in std.string (remember I rarely use D's string processing utilities). It never really occurred to me that I might want to check std.array for the function I wanted. So what it std.array is imported when I import std.string, as a programmer I still had no idea 'split()' was there!<br>

<br>
At the very least the documentation for std.string should say something along the lines of:<br>
<br>
"The libraries std.unicode and std.array also include a number of functions that operate on strings, so if what you are looking for isn't here, try looking there."<br></blockquote><div><br></div><div>Or just alias the functions useful for string processing...</div>
</div></div></div>