Array Methods
Microsoft Silverlight will reach end of support after October 2021. Learn more.
Include Protected Members
Include Inherited Members
Include Silverlight Members
Include Silverlight for Windows Phone Members
Include XNA Framework Members
The Array type exposes the following members.
Methods
Name | Description | |
---|---|---|
AsReadOnly<T> | Returns a read-only wrapper for the specified array. | |
BinarySearch(Array, Object) | Searches an entire one-dimensional sorted Array for a specific element, using the IComparable interface implemented by each element of the Array and by the specified object. | |
BinarySearch(Array, Int32, Int32, Object, IComparer) | Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer interface. | |
BinarySearch<T>(array<T[], T) | Searches an entire one-dimensional sorted Array for a specific element, using the IComparable<T> generic interface implemented by each element of the Array and by the specified object. | |
BinarySearch<T>(array<T[], T, IComparer<T>) | Searches an entire one-dimensional sorted Array for a value using the specified IComparer<T> generic interface. | |
BinarySearch<T>(array<T[], Int32, Int32, T) | Searches a range of elements in a one-dimensional sorted Array for a value, using the IComparable<T> generic interface implemented by each element of the Array and by the specified value. | |
BinarySearch<T>(array<T[], Int32, Int32, T, IComparer<T>) | Searches a range of elements in a one-dimensional sorted Array for a value, using the specified IComparer<T> generic interface. | |
Clear | Sets a range of elements in the Array to zero, to false, or to nulla null reference (Nothing in Visual Basic), depending on the element type. | |
Clone | Creates a shallow copy of the Array. | |
ConstrainedCopy | Copies a range of elements from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely. | |
Copy(Array, Array, Int32) | Copies a range of elements from an Array starting at the first element and pastes them into another Array starting at the first element. The length is specified as a 32-bit integer. | |
Copy(Array, Int32, Array, Int32, Int32) | Copies a range of elements from an Array starting at the specified source index and pastes them to another Array starting at the specified destination index. The length and the indexes are specified as 32-bit integers. | |
CopyTo | Copies all the elements of the current one-dimensional Array to the specified one-dimensional Array starting at the specified destination Array index. The index is specified as a 32-bit integer. | |
CreateInstance(Type, Int32) | Creates a one-dimensional Array of the specified Type and length, with zero-based indexing. | |
CreateInstance(Type, array<Int32[]) | Creates a multidimensional Array of the specified Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers. | |
Equals(Object) | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before the Object is reclaimed by garbage collection. (Inherited from Object.) | |
ForEach<T> | Performs the specified action on each element of the specified array. | |
GetEnumerator | Returns an IEnumerator for the Array. | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetLength | Gets a 32-bit integer that represents the number of elements in the specified dimension of the Array. | |
GetLowerBound | Gets the lower bound of the specified dimension in the Array. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetUpperBound | Gets the upper bound of the specified dimension in the Array. | |
GetValue(Int32) | Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer. | |
GetValue(array<Int32[]) | Gets the value at the specified position in the multidimensional Array. The indexes are specified as an array of 32-bit integers. | |
IndexOf(Array, Object, Int32, Int32) | Searches for the specified object and returns the index of the first occurrence within the range of elements in the one-dimensional Array that starts at the specified index and contains the specified number of elements. | |
IndexOf<T>(array<T[], T) | Searches for the specified object and returns the index of the first occurrence within the entire Array. | |
IndexOf<T>(array<T[], T, Int32) | Searches for the specified object and returns the index of the first occurrence within the range of elements in the Array that extends from the specified index to the last element. | |
IndexOf<T>(array<T[], T, Int32, Int32) | Searches for the specified object and returns the index of the first occurrence within the range of elements in the Array that starts at the specified index and contains the specified number of elements. | |
Initialize | Initializes every element of the value-type Array by calling the default constructor of the value type. | |
LastIndexOf(Array, Object, Int32, Int32) | Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional Array that contains the specified number of elements and ends at the specified index. | |
LastIndexOf<T>(array<T[], T) | Searches for the specified object and returns the index of the last occurrence within the entire Array. | |
LastIndexOf<T>(array<T[], T, Int32) | Searches for the specified object and returns the index of the last occurrence within the range of elements in the Array that extends from the first element to the specified index. | |
LastIndexOf<T>(array<T[], T, Int32, Int32) | Searches for the specified object and returns the index of the last occurrence within the range of elements in the Array that contains the specified number of elements and ends at the specified index. | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
Resize<T> | Changes the number of elements of an array to the specified new size. | |
Reverse(Array) | Reverses the sequence of the elements in the entire one-dimensional Array. | |
Reverse(Array, Int32, Int32) | Reverses the sequence of the elements in a range of elements in the one-dimensional Array. | |
SetValue(Object, Int32) | Sets a value to the element at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer. | |
SetValue(Object, array<Int32[]) | Sets a value to the element at the specified position in the multidimensional Array. The indexes are specified as an array of 32-bit integers. | |
Sort(Array) | Sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array. | |
Sort(Array, IComparer) | Sorts the elements in a one-dimensional Array using the specified IComparer. | |
Sort(Array, Array, IComparer) | Sorts a pair of one-dimensional Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the specified IComparer. | |
Sort(Array, Int32, Int32, IComparer) | Sorts the elements in a range of elements in a one-dimensional Array using the specified IComparer. | |
Sort(Array, Array, Int32, Int32, IComparer) | Sorts a range of elements in a pair of one-dimensional Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the specified IComparer. | |
Sort<T>(array<T[]) | Sorts the elements in an entire Array using the IComparable<T> generic interface implementation of each element of the Array. | |
Sort<T>(array<T[], IComparer<T>) | Sorts the elements in an Array using the specified IComparer<T> generic interface. | |
Sort<T>(array<T[], Comparison<T>) | Sorts the elements in an Array using the specified Comparison<T>. | |
Sort<T>(array<T[], Int32, Int32) | Sorts the elements in a range of elements in an Array using the IComparable<T> generic interface implementation of each element of the Array. | |
Sort<T>(array<T[], Int32, Int32, IComparer<T>) | Sorts the elements in a range of elements in an Array using the specified IComparer<T> generic interface. | |
Sort<TKey, TValue>(array<TKey[], array<TValue[]) | Sorts a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the IComparable<T> generic interface implementation of each key. | |
Sort<TKey, TValue>(array<TKey[], array<TValue[], IComparer<TKey>) | Sorts a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the specified IComparer<T> generic interface. | |
Sort<TKey, TValue>(array<TKey[], array<TValue[], Int32, Int32) | Sorts a range of elements in a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the IComparable<T> generic interface implementation of each key. | |
Sort<TKey, TValue>(array<TKey[], array<TValue[], Int32, Int32, IComparer<TKey>) | Sorts a range of elements in a pair of Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first Array using the specified IComparer<T> generic interface. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Top
Extension Methods
Name | Description | |
---|---|---|
AsQueryable | Converts an IEnumerable to an IQueryable. (Defined by Queryable.) | |
Cast<TResult> | Converts the elements of an IEnumerable to the specified type. (Defined by Enumerable.) | |
OfType<TResult> | Filters the elements of an IEnumerable based on a specified type. (Defined by Enumerable.) |
Top
Explicit Interface Implementations
Name | Description | |
---|---|---|
IList.Add | Implements IList.Add. Throws a NotSupportedException in all cases. | |
IList.Clear | Sets all elements in the Array to zero, to false, or to nulla null reference (Nothing in Visual Basic), depending on the element type. | |
IList.Contains | Determines whether an element is in the Array. | |
IList.IndexOf | Searches for the specified object and returns the index of the first occurrence within the current one-dimensional instance. | |
IList.Insert | Implements IList.Insert. Throws a NotSupportedException in all cases. | |
IList.Remove | Implements IList.Remove. Throws a NotSupportedException in all cases. | |
IList.RemoveAt | Implements IList.RemoveAt. Throws a NotSupportedException in all cases. | |
IStructuralComparable.CompareTo | Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order. | |
IStructuralEquatable.Equals | Determines whether an object is equal to the current instance. | |
IStructuralEquatable.GetHashCode | Returns a hash code for the current instance. |
Top