开发者

Every nth Item In A Collection in VB.Net

Nearly identical to How can I get every nth item from a L开发者_运维百科ist<T>?

But I'm having trouble turning

 List<T> list = originalList.Where((t,i) => (i % 5) == 0).ToList();

Into VB.Net code.


It becomes

Dim list as List(Of T) = originalList.Where(Function(t,i) (i Mod 5) = 0).ToList()

Lambdas in Visual Basic use the Function and Sub keywords.


Literally, that would be:

dim list as List(of T) = originalList.Where(Function(t, i) (i mod 5) = 0).ToList()
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜