I need to move backwards through an array, so I have code like this:
for (int i = myArray.Length - 1; i >= 0; i--) { // Do something myArray[i] = 42; }
Is there a better way of doing this?
Update: I was hoping that maybe C# had some built-in mechanism for this like:
foreachbackwards (int i in myArray) { // so easy }
While admittedly a bit obscure, I would say that the most typographically pleasing way of doing this is