On Sunday, 29 December 2019 at 08:31:13 UTC, mipri wrote:
int i = a.countUntil!(v => v == 55); assert(i == 2);
I also had to ask because I couldn't find it. In other languages it's named "index()", "indexOf()" or "find()". D is the only language I know which uses the "countUntil" scheme. And even so it's not obvious from the name if it's the index of the element or number of preceding elements.