Posts

Showing posts from May, 2016

Split list into sublists using LINQ in C#.NET

Here is the sample LINQ C# code to split list into sublistspublicstaticList<List<T>>Split<T>(thisList<T> source, intNumberOfGroup)         { returnsource                 .Select((x, i)=>new{ Index= i, Value= x})                 .GroupBy(x=> x.Index/ NumberOfGroup)                 .Selec