Replacing tango.text.Ascii.isearch

torhu torhu at yahoo.com
Wed Oct 5 21:50:32 UTC 2022


On Wednesday, 5 October 2022 at 17:29:25 UTC, Steven 
Schveighoffer wrote:

> ```d
> bool isearch(S1, S2)(S1 haystack, S2 needle)
> {
>     import std.uni;
>     import std.algorithm;
>     return haystack.asLowerCase.canFind(needle.asLowerCase);
> }
> ```
>
> untested.
>
> -Steve

I did some basic testing, and regex was two orders of magnitude 
faster. So now I know, I guess.


More information about the Digitalmars-d-learn mailing list