Is it possible to write a foreach so that it simultaneously iterates through
two collections ( or two properties of the same collection ) ?
Following is *only meant as an example* :
-- iterate a dictionary obtaining the next key and value on each iteration.
The following doesn't work
foreach ( string key in MyDictionary.Ke ys , object value in
MyDictionary.Va lues )
{
.... but perhaps there's some other way ...
two collections ( or two properties of the same collection ) ?
Following is *only meant as an example* :
-- iterate a dictionary obtaining the next key and value on each iteration.
The following doesn't work
foreach ( string key in MyDictionary.Ke ys , object value in
MyDictionary.Va lues )
{
.... but perhaps there's some other way ...
Comment