Iterating over lists in C# is often done using for
loops. This tutorial shows how the foreach
construct can be coupled with the yield
statement to create more elegant and safe code.
- Introduction
- Part 1. Implementation
- Part 2. The yield Statement
- Part 3. Limitations
- Conclusion