using foreach to iterate simultaneously through multiple lists (syntax sugar)
Hi is there a way to do things like this:
for (int i = 0; i < Math.Min(a.Count, b.Count); i++)
{
// Do stuff
//a[i]
//b[i]
}
with Foreach?
because it would be nice to write something like
foreach(var item1 in list1 and var item2 in list2 /* ....*/)
{
item1.use(item2);
}
No comments:
Post a Comment