Split a List into parts - VB conversion fails
问题 Trying to write a method that splits a list into sublists. Private Function SplitIdsIntoChunks(ByVal keys As List(Of String)) As List(Of List(Of String)) Return keys _ .Select(Function(x, i) New With {Key .Index = i, Key .Value = x}) _ .GroupBy(Function(x) (x.Index / 10000)) _ .Select(Function(x) x.Select(Function(v) v.Value).ToList()) _ .ToList() End Function I used C# solution from here. C# solution works fine. My version written in VB returns a collection of lists with one element instead