I have two lists
List
Now i want to iterate throug
If you want to iterate through them individually then you can use Enumerable.Concat
as has already been pointed out.
If you want to iterate over both lists simultaneously, having access to one element from each inside your loop, then in .NET 4.0 there is a method Enumerable.Zip that you can use.
int[] numbers = { 1, 2, 3, 4 };
string[] words = { "one", "two", "three" };
var numbersAndWords = numbers.Zip(words, (first, second) => first + " " + second);
foreach (var item in numbersAndWords)
{
Console.WriteLine(item);
}
Result:
1 one 2 two 3 three