replaceFirst, findPieces, and takeExactly

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sat Jan 22 21:21:03 PST 2011


On 1/22/11 10:59 PM, Jonathan M Davis wrote:
> This will be a _fantastic_ function to have. I think that I probably even have
> an enhancement request somewhere that includes such a function. It's far too
> common that you have to find something and you want both what is before and after
> the point that you find. Now, that being the case, I'd probably more commonly find
> it useful to get the part before what was found and then the part beginning with
> what was found, but this works too.

I suspect there might be a simple and intuitive way to define a family 
of functions that give you whatever portions of the find you're 
interested in (before, match, after, before and match, match and after). 
That could be either a naming convention or a template argument. Any 
ideas, let me know.

Andrei


More information about the Digitalmars-d mailing list