Public Overridable Function ToString As String Sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array. The index is specified as a 32-bit integer. Sets a value to the element at the specified position in the one-dimensional Array. Public Sub SetValue (value As Object, index As Integer) Reverses the sequence of the elements in the entire one-dimensional Array. Public Shared Sub Reverse (array As Array) Searches for the specified object and returns the index of the first occurrence within the entire one-dimensional Array. Public Shared Function IndexOf (array As Array,value As Object) As Integer Gets the value at the specified position in the one-dimensional Array. Public Function GetValue (index As Integer) As Object Gets the upper bound of the specified dimension in the Array. Public Function GetUpperBound (dimension As Integer) As Integer Gets the Type of the current instance (Inherited from Object). Gets the lower bound of the specified dimension in the Array. Public Function GetLowerBound (dimension As Integer) As Integer Gets a 64-bit integer that represents the number of elements in the specified dimension of the Array. Public Function GetLongLength (dimension As Integer) As Long Gets a 32-bit integer that represents the number of elements in the specified dimension of the Array. Public Function GetLength (dimension As Integer) As Integer Public Sub CopyTo (array As Array, index As Integer)Ĭopies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. The length is specified as a 32-bit integer. Public Shared Sub Copy (sourceArray As Array, destinationArray As Array, length As Integer)Ĭopies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. Sets a range of elements in the Array to zero, to false, or to null, depending on the element type. Public Shared Sub Clear (array As Array, index As Integer, length As Integer) ![]() The following table provides some of the most commonly used methods of the Array class − Sr.No Gets the rank (number of dimensions) of the Array. Gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array. Gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array. Gets a value indicating whether the Array is read-only. Gets a value indicating whether the Array has a fixed size. The following table provides some of the most commonly used properties of the Array class − Sr.No ![]() The Array class provides various properties and methods to work with arrays. The Array class is the base class for all the arrays in VB.Net. When the above code is compiled and executed, it produces the following result − For example,ĭim intData() As Integer = ", i, j, a(i)(j)) You can also initialize the array elements while declaring the array. For example,ĭim intData(30) ' an array of 31 elementsĭim strData(20) As String ' an array of 21 stringsĭim twoDarray(10, 20) As Integer 'a two dimensional array of integersĭim ranges(10, 100) 'a two dimensional array To declare an array in VB.Net, you use the Dim statement. The lowest address corresponds to the first element and the highest address to the last element. An array is used to store a collection of data, but it is often more useful to think of an array as a collection of variables of the same type.Īll arrays consist of contiguous memory locations. An array stores a fixed-size sequential collection of elements of the same type.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |