get element index when using each!(x)

dangbinghoo dangbinghoo at google-mail.com
Thu Sep 17 00:51:54 UTC 2020


hi,

is there any way to get the index for an element when iteration 
using each!(x)?

  I know I can do this using foreach statement, but I prefer using 
the each template.

-----------
string s = "hello";
foreach(i, c; s) {
}
----------

how can I get to ?


Thanks!

binghoo dang


More information about the Digitalmars-d-learn mailing list