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()
精彩评论