How can I remove all null elements from an array object[,] in C#. I've already seen the similar question in StackOverflow : Remove blank values in the array using c#
The problem is they are using a method called Where() to solve the problem with a simple array type object[], but I'm dealing with an array type object[,] and there is unfortunately no method Where() implemented for this class. For example :
object[,] data = new object[2,2]{{null,null},{1,2}};
Then, data contains :
[0, 0] [object]:null
[0, 1] [object]:null
[1, 0] [object]:1
[1, 1] [object]:2
As you can see (in my specific case), if one element is null then all the row of this element is null. I would like to get :
[0, 0] [object]:1
[0, 1] [object]:2
Any help ?