Coding Helpers – Reverse For Loop
August 9th, 2012
When working with arrays and lists enumerating all of its items we usually create a for loop statement as follows:
But what if we want array items to be listed in reverse? Sometimes, we want to create a loop that starts from a larger number and decrements the iterator variable’s value after each iteration until zero is reached. In this case, we can easily reverse the loop using the Reverse For Loop code provider:
Once it is applied, it will change the order in which items are enumerated in the loop as illustrated in the preview hint:
The code provider can invert loops written in different kinds of ways in any supported programming language.
—– Products: CodeRush Pro Versions: 12.1 and up VS IDEs: 2008 and up Updated: Aug/09/2012 ID: C173