foreach (String s in arrayOfMessages) { System.Console.WriteLine(s); }
string[,] arrayOfMessages is being passed in as a parameter
string[,] arrayOfMessages
Don't use foreach - use nested for loops, one for each dimension of the array.
foreach
for
You can get the number of elements in each dimension with the GetLength method.
See Multidimensional Arrays (C# Programming Guide) on MSDN.