replaceFirst, findPieces, and takeExactly

so so at so.do
Sat Jan 22 15:40:44 PST 2011


> Yes, I'm absolutely in agreement with the naming (and thrilled too). I  
> imagine a putative user looking through std.algorithm ("let's see...  
> what find functions are out there?"). That makes findPieces easy to get  
> to, whereas "trisect" would be oddly situated in the alphabetic list and  
> oddly named enough to be virtually undiscoverable.

If this is the reasoning. This is a split function, not a find.
There will be a few more of these split functions i suppose and this is  
the reason of my proposal splitAt.
It is in the definition of the function you quoted.

"(Split) the string (at) the first occurrence of (sep)"

splitAt(string, sep)

We can also overload it.

split(string, sep) // splits in two
split(string, sep, count)


More information about the Digitalmars-d mailing list