How to most elegantly iterate through parallel collections in C#?

.net, c#-3.0, collections, linq, puzzle

Solution

This is known as "zipping" or "zip joining" two sequences. Eric Lippert describes this very algorithm and provides an implementation.

Problem

``` var a = new Collection<string> {"a", "b", "c"}; var b = new Collection<int> { 1, 2, 3 }; ``` What is the most elegant way to iterate through both yielding a set of results "a1", "b2", "c3"?

Original source