access foreach index counter for Iterate n times

Adam D Ruppe destructionator at gmail.com
Sat May 21 11:59:42 UTC 2022


On Saturday, 21 May 2022 at 03:01:39 UTC, mw wrote:
> Yes! let's call it "loop counter"

It isn't a loop counter. It is an index back into the original 
source. Consider:

foreach(INDEX, dchar character; "“”")
    writeln(INDEX); // 0 then 3



More information about the Digitalmars-d mailing list