This Refactoring is used to switch between the for loop and foreach loop. The foreach loop is more readable and compact. On the other hand, if your algorithm uses the iteration number for calculations, the for loop is more applicable.
In rare cases, the ForEach to For refactoring may change your code's external behavior if the IEnumerator implementation causes significant side effects, or if any of the IEnumerator members behave in a non-standard manner.
Available when the caret is on the for or foreach keyword.
Place the caret on a foreach keyword.
The blinking cursor shows the caret's position at which the Refactoring is available.