How do I limit the number of elements iterated over in a foreach loop?

前端 未结 6 2113
伪装坚强ぢ
伪装坚强ぢ 2021-02-05 08:34

I have the following code

foreach (var rssItem in rss.Channel.Items)
{
    // ...
}

But only want 6 items not all items, how can I do it in C#?

6条回答
提交回复
热议问题