Simon Mann

Simon Mann

  • NA
  • 1
  • 0

Using multiple lists in a single 'foreach'

Jun 19 2008 8:07 AM
Hey there, I'm new and was wondering if someone coud help me out.

I was wondering whether it's possible to have two lists being parsed by the same foreach loop.

i.e.
foreach (Object obj in _objectList)

becoming

foreach (Object obj in _objectList, Client cli in _clientList)


The logic I'm trying to parse involves the method being able to call values from both lists and using them together. I tried calling two foreach loops, but they seem unable to share their data.

Cheers in advance for any help.


Answers (1)