This is my code:
List<string> l1 = new List<string> { "a", "b", "c" };
List<string> l2 = new List<string> { "x", "y", "z" };
foreach (var item in l1)
{
item = MyFunction(item);
}
foreach (var item in l1)
{
item = MyFunction(item);
}
Is there a way to iterate both the Lists in a single foreach statement ?
Assuming the type of the
Listobjects are the same you can useConcat.