Need help: Return reference slice

Steven Schveighoffer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Oct 30 08:41:18 PDT 2014


On 10/30/14 11:06 AM, bearophile wrote:
> 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".

Sure, I didn't touch OP's function body, just the signature.

-Steve



More information about the Digitalmars-d-learn mailing list