On Sat, 23 Jun 2012 20:41:29 +0200, Chad J
<chadjoan@__spam.is.bad__gmail.com> wrote:
Hey, thanks for doing all of that. I didn't expect you to write all of
that.
np
Once I've established that the issue isn't just a lack of learning on
my part, my subsequent objective is filling any missing functionality in
phobos. IMO the "take away a single line" thing should be
accomplishable with a single concise expression. Then there should be a
function in std.string that contains that single expression and wraps it
in easy-to-find documentation. This kind of thing is a fairly common
operation. Otherwise, I find it odd that there is a function to split
up an arbitrary number of lines but no function to split off only one!
Also, any function that works with whitespace should have
versions/variants that work with arbitrary delimiters. Not unless it is
impossible to generalize it that way for some reason. If the variants
are found in a separate module, then the documentation should reference
them.
The problem here is there isn't a version of findSplit only taking a
predicate and not a needle.
If it had an overload just taking a function, you could have solved it by
writing:
auto res = myText.findSplit!(a => a.startsWith("\r\n", "\n", "\r"));