Foreach Loop

This lesson discusses the foreach loop and its implementation in C#

We'll cover the following


The foreach statement is similar to the for statement in that both allow code to iterate over the items of collections, but the foreach statement lacks an iteration index, so it works even with collections that lack indices altogether.


It is written in the following form:

Get hands-on with 1200+ tech skills courses.