GetUpperBound

来源:互联网 发布:office2016激活 知乎 编辑:程序博客网 时间:2024/06/12 03:55

GetUpperBound获取数组的最高下标。 GetLowerBound可以获取数组的最低下标。 例如:

string[ ] strArray = new string[3];

for(int x=0;x<=strArray.GetUpperBound(0) ;x++)

这样就可以实现对数组的遍历,因为

strArray.GetUpperBound(0) = 2;