How to get the Upper Bound of an Array in C#
The upper bound of the array can be retrieved using the Length property as shown below:
private void GetUbound()
{
String[] arTemp = {"First","Second"};
MessageBox.Show (arTemp.Length.ToString ());
}
This is incorrect. The upper bounds of your example is 1. So arTemp.Length - 1.
ReplyDelete