What is the proper way to handle a 2D array with LINQ?
int[,] array =
{
{ 1, 2, 3 },
{ 4, 5, 6 },
{ 7, 8, 9 }
};
bool anyZeroes = array.Any(value => value == 0) // example
I want to check if any variable in the array matches a Func
, == 0
in this case. How can I use Any
for this and what is the best practice here?