System.Array
This is an abstract base class which means you cannot create an instance of this class
This class provides a CreateInstance method for creating an instance of an array.
The first parameter is the type.
The second parameter is the dimension
Once an array has been created, we can use the SetValue method to add items to an array
System.Array myArray;
myArray = System.Array.CreateInstance(GetType(string),3);
myArray.SetValue("one",0);
myArray.SetValue("two",1);
myArray.SetValue("three",2);
myArray = System.Array.CreateInstance(GetType(string),3,"one","two","three");
sValue = System.Convert.ToString(myArray.GetValue(2));
Methods/Properties
Clear | Public shared method that sets a range of elements in the array to zero or to a null reference. |
Copy | Overloaded public shared method that copies a section of one array to another array |
GetLength | Returns a 32 bit Integer representing the number of elements in the specified dimension |
GetLongLength | Returns a 64 bit Integer representing the number of elements in the specified dimension |
GetLowerBound | Get the upper bound of the specified dimension. Starting at the number 0. |
GetUpperBound | Get the lower bound of the specified dimension. Starting at the number 0. |
GetValue | Gets the value of the specified element in the array. Starting at the number 1. |
IndexOf | Overloaded public shared method that returns the index (offset) of the first instance of a value in a one-dimensional array. |
IsFixedSize | Returns a value indicating whether the array has a fixed size |
IsReadOnly | Returns a value indicating if an array is readonly or not |
LastIndexOf | Overloaded public shared method that returns the index of the last instance of a value in a one-dimensional array. |
Length | Public property that returns the length of the array. Returns a 32 bit Integer representing the total number of elements in all the dimensions of the array. |
LongLength | Returns a 64 bit Integer representing the total number of elements in all the dimensions of the array. |
Rank | Returns the number of dimensions of the array. |
Resize | |
Reverse | Overloaded public shared method that reverses the order of elements in a one dimensional array |
Sort | Overloaded public shared method that sorts the values in a one-dimensional array. |
© 2024 Better Solutions Limited. All Rights Reserved. © 2024 Better Solutions Limited TopPrevNext