Click here to Skip to main content
15,876,991 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I have a three-dimensional list and I want to sort every column with LINQ. Please guide me...
List<List<List<float>>> matrix = new List<List<List<float>>>();
Updated 1-Nov-11 23:10pm

1 solution

If the declaration of your list is: List<List<List<float>>> matrix;, you can sort it as the following:

matrix.ForEach(l1 => l1.ForEach(l2 => l2.Sort()));
Share this answer
Mehdi Gholam 2-Nov-11 4:42am    
my 5!
vahid_erad 2-Nov-11 5:07am    
tnx dear
but what is 11 and 12 ???
Shmuel Zang 2-Nov-11 5:21am    
It isn't 11 and 12 it's l1 and l2. You can read more about lambda-expressions here.
Shmuel Zang 2-Nov-11 5:17am    
Thank you Mehdi.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900