How to loop through a collection that supports IEnumerable?

后端 未结 5 1435
不知归路
不知归路 2020-12-23 20:00

How to loop through a collection that supports IEnumerable?

5条回答
  •  北海茫月
    2020-12-23 20:43

    A regular for each will do:

    foreach (var item in collection)
    {
        // do your stuff   
    }
    

提交回复
热议问题