//2D陣列 XXX.GetUpperBound(0);
using System;
public class Program
{
public static void Main()
string[,] XXX = new string[,]
{"Air", "Bird"},
{"Cat", "Dog"}
};
// Get the upper bound.
// ... Use for-loop over rows.
for (int i = 0; i <= XXX.GetUpperBound(0); i++)
string s1 = XXX[i, 0]; //將XXX陣列中i,0位置之元素取出作為s1
string s2 = XXX[i, 1]; //將XXX陣列中i,1位置之原宿取出作為s2
Console.WriteLine("{0}, {1}", s1, s2);//第0與第1位置分別放s1,s2
Console.WriteLine(XXX.GetUpperBound(0));
}