I've been playing around for a little bit trying to find the best way of taking a List<double> of variable size and splitting it in to sub-lists of size n. So maybe a method stub like
public List<List<double>> splitData(int width,List<double> data)
The problem is i cant get my head around how to iterate through the parameter "data" properly when the data.count is not exactly divisible by the parameter "width". I have been trying for loops but i think i need to switch to do whiles.
I'm not massively familiar with LINQ but could anyone advise if LINQ would provide an alternative way of doing it?
Any help much appreciated
View Complete Post