Iterating Collections

There's no faster way to iterate!

Get your hands some rest! 😌

Dealing with collection-like objects is easy if you have live and postfix templates at your finger tips. Either write foreach as a single word, or add .foreach at the end of your collection object. Then, just hit (macOS) / Tab (VS Windows/Linux) and confirm the different hotspot variables: collection object (only live template), type name vs. var keyword, and the iteration variable name. In most cases, the variable name can already be inferred from the collection object name. Good naming pays off! 😉

Which way is your favorite? ⭐️

See Also


Related Resources

C# 8 Support
Master all the C# 8 language features!
Move Code
Move code the smart way!