Iterate Multi-Dimensional Array with Nested Foreach Statement
- by Tyler Murry
I think this might be a pretty simple question, but I haven't been able to figure it out yet. If I've got a 2-dimensional array like so:
int[,] = new int[2,3] { {1, 2, 3}, {4, 5, 6} };
What's the best way to iterate through each dimension of the array with a nested foreach statement?