I have made a code that does the following:
public List<List<object>> SegmentarLista(List<object> origen, tamaño){
resultado= new List<List<object>>();
for (int i=0; i<origen.Length;i+tamaño){
resultado.Add(origen.GetRange(i,tamaño))
}
}
Would there be any way to do this with Linq without the for?
edit: The question is not in search of efficiency, nor readability. It is pure curiosity about how to achieve the same in a more functional way, with immutable variables.