Using foreach loop to iterate through two lists

后端 未结 5 1747
攒了一身酷
攒了一身酷 2021-02-12 15:39

I have two lists

List a = new List();
List b = new List();


Now i want to iterate throug

5条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-12 16:36

    foreach(object o in a.Concat(b)) {
     o.DoSomething();
    }
    

提交回复
热议问题