Need help: Return reference slice

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 30 08:06:58 PDT 2014


Steven Schveighoffer:

>   long a = src.countUntil(start);
>   if (a < 0)
>     return src; // null
>   a += start.length;
>   long b = src[a..$].countUntil(end);

I think there it's better to use "auto" instead of "long".

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list