[Removed microsoft.public.dotnet.csharp.general, which isn't a valid
group - at least not on the MS server.]
john bailo <jb****@vestcom.com> wrote:
string in[], out[]
//both have three elements
foreach ( string str in in[] )
Console.Writeline( str );
writes all the strings in in[]
now i want to loop through both in and out using the same str counter in the
foreach.
how can i do this?
The easiest way of doing it if you were going to do it a lot and really
wanted to keep the foreach syntax would be to create a new class which
took the two arrays and was enumerable, giving out a pair reference for
each iteration - the pair would contain the in and the out, if you see
what I mean.
Unless you're doing it a lot, however, it's probably easier (although
not as pleasant) to just use a normal for loop.
--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too