Loops


Length


You can return the number of elements in an array by using the Length property

Debug.WriteLine aiArrayIntegers(10).Length; 

All arrays are zero based

for (int I = myArray.GetLowerBound(0); I <= myArray.GetUpperBound(0); i++) 
{
     Debug.WriteLine(aiArrayIntegers(i);
}

for (int I = 0; I <= myArray.Length - 1; i++) 
{
     Debug.WriteLine(aiArrayIntegers(i);
}

However, arrays implement the IList interface so you can enumerate it as well:

foreach (string myvalue in myArray) 
{
{




© 2021 Better Solutions Limited. All Rights Reserved. © 2021 Better Solutions Limited TopPrevNext