Click or drag to resize
Array Class
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.
Inheritance Hierarchy
SystemObject
  SystemArray

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
[SerializableAttribute]
public abstract class Array : ICloneable, 
	IList, ICollection, IEnumerable, IStructuralComparable, IStructuralEquatable

The Array type exposes the following members.

Methods
  NameDescription
Public methodStatic memberAsReadOnlyT
Returns a read-only wrapper for the specified array.
Public methodStatic memberClear
Sets a range of elements in the Array to zero, to false, or to null, depending on the element type.
Public methodClone
Creates a shallow copy of the Array.
Public methodStatic memberConvertAllTInput, TOutput
Converts an array of one type to an array of another type.
Public methodStatic memberCopy(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.
Public methodStatic memberCopy(Array, Array, Int64)
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 64-bit integer.
Public methodStatic memberCopy(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.
Public methodStatic memberCopy(Array, Int64, Array, Int64, Int64)
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 64-bit integers.
Public methodCopyTo(Array, Int32)
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.
Public methodCopyTo(Array, Int64)
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 64-bit integer.
Public methodStatic memberCreateInstance(Type, Int32)
Creates a one-dimensional Array of the specified Type and length, with zero-based indexing.
Public methodStatic memberCreateInstance(Type, 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.
Public methodStatic memberCreateInstance(Type, Int64)
Creates a multidimensional Array of the specified Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.
Public methodStatic memberCreateInstance(Type, Int32, Int32)
Creates a two-dimensional Array of the specified Type and dimension lengths, with zero-based indexing.
Public methodStatic memberCreateInstance(Type, Int32, Int32)
Creates a multidimensional Array of the specified Type and dimension lengths, with the specified lower bounds.
Public methodStatic memberCreateInstance(Type, Int32, Int32, Int32)
Creates a three-dimensional Array of the specified Type and dimension lengths, with zero-based indexing.
Public methodEquals(Object)
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Public methodStatic memberExistsT
Determines whether the specified array contains elements that match the conditions defined by the specified predicate.
Public methodStatic memberFindT
Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire Array.
Public methodStatic memberFindAllT
Retrieves all the elements that match the conditions defined by the specified predicate.
Public methodStatic memberFindIndexT(T, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire Array.
Public methodStatic memberFindIndexT(T, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the Array that extends from the specified index to the last element.
Public methodStatic memberFindIndexT(T, Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based 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.
Public methodStatic memberFindLastT
Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire Array.
Public methodStatic memberFindLastIndexT(T, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire Array.
Public methodStatic memberFindLastIndexT(T, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the Array that extends from the first element to the specified index.
Public methodStatic memberFindLastIndexT(T, Int32, Int32, PredicateT)
Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based 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.
Public methodStatic memberForEachT
Performs the specified action on each element of the specified array.
Public methodGetEnumerator
Returns an IEnumerator for the Array.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetValue(Int32)
Gets the value at the specified position in the one-dimensional Array. The index is specified as a 32-bit integer.
Public methodGetValue(Int32)
Gets the value at the specified position in the multidimensional Array. The indexes are specified as an array of 32-bit integers.
Public methodGetValue(Int64)
Gets the value at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer.
Public methodGetValue(Int64)
Gets the value at the specified position in the multidimensional Array. The indexes are specified as an array of 64-bit integers.
Public methodGetValue(Int32, Int32)
Gets the value at the specified position in the two-dimensional Array. The indexes are specified as 32-bit integers.
Public methodGetValue(Int64, Int64)
Gets the value at the specified position in the two-dimensional Array. The indexes are specified as 64-bit integers.
Public methodGetValue(Int32, Int32, Int32)
Gets the value at the specified position in the three-dimensional Array. The indexes are specified as 32-bit integers.
Public methodGetValue(Int64, Int64, Int64)
Gets the value at the specified position in the three-dimensional Array. The indexes are specified as 64-bit integers.
Public methodStatic memberIndexOf(Array, Object)
Searches for the specified object and returns the index of the first occurrence within the entire one-dimensional Array.
Public methodStatic memberIndexOf(Array, Object, 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 extends from the specified index to the last element.
Public methodStatic memberIndexOf(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.
Public methodStatic memberIndexOfT(T, T)
Searches for the specified object and returns the index of the first occurrence within the entire Array.
Public methodStatic memberIndexOfT(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.
Public methodStatic memberIndexOfT(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.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodStatic memberResizeT
Changes the number of elements of an array to the specified new size.
Public methodSetValue(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.
Public methodSetValue(Object, 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.
Public methodSetValue(Object, Int64)
Sets a value to the element at the specified position in the one-dimensional Array. The index is specified as a 64-bit integer.
Public methodSetValue(Object, Int64)
Sets a value to the element at the specified position in the multidimensional Array. The indexes are specified as an array of 64-bit integers.
Public methodSetValue(Object, Int32, Int32)
Sets a value to the element at the specified position in the two-dimensional Array. The indexes are specified as 32-bit integers.
Public methodSetValue(Object, Int64, Int64)
Sets a value to the element at the specified position in the two-dimensional Array. The indexes are specified as 64-bit integers.
Public methodSetValue(Object, Int32, Int32, Int32)
Sets a value to the element at the specified position in the three-dimensional Array. The indexes are specified as 32-bit integers.
Public methodSetValue(Object, Int64, Int64, Int64)
Sets a value to the element at the specified position in the three-dimensional Array. The indexes are specified as 64-bit integers.
Public methodStatic memberSort(Array)
Sorts the elements in an entire one-dimensional Array using the IComparable implementation of each element of the Array.
Public methodStatic memberSort(Array, Array)
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 IComparable implementation of each key.
Public methodStatic memberSort(Array, IComparer)
Sorts the elements in a one-dimensional Array using the specified IComparer.
Public methodStatic memberSort(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.
Public methodStatic memberSort(Array, Int32, Int32)
Sorts the elements in a range of elements in a one-dimensional Array using the IComparable implementation of each element of the Array.
Public methodStatic memberSort(Array, Array, Int32, Int32)
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 IComparable implementation of each key.
Public methodStatic memberSort(Array, Int32, Int32, IComparer)
Sorts the elements in a range of elements in a one-dimensional Array using the specified IComparer.
Public methodStatic memberSort(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.
Public methodStatic memberSortT(T)
Sorts the elements in an entire Array using the IComparableT generic interface implementation of each element of the Array.
Public methodStatic memberSortT(T, IComparerT)
Sorts the elements in an Array using the specified IComparerT generic interface.
Public methodStatic memberSortT(T, ComparisonT)
Sorts the elements in an Array using the specified ComparisonT.
Public methodStatic memberSortT(T, Int32, Int32)
Sorts the elements in a range of elements in an Array using the IComparableT generic interface implementation of each element of the Array.
Public methodStatic memberSortT(T, Int32, Int32, IComparerT)
Sorts the elements in a range of elements in an Array using the specified IComparerT generic interface.
Public methodStatic memberSortTKey, TValue(TKey, 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 IComparableT generic interface implementation of each key.
Public methodStatic memberSortTKey, TValue(TKey, TValue, IComparerTKey)
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 IComparerT generic interface.
Public methodStatic memberSortTKey, TValue(TKey, 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 IComparableT generic interface implementation of each key.
Public methodStatic memberSortTKey, TValue(TKey, TValue, Int32, Int32, IComparerTKey)
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 IComparerT generic interface.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodStatic memberTrueForAllT
Determines whether every element in the array matches the conditions defined by the specified predicate.
Top
Properties
  NameDescription
Public propertyLength
Gets a 32-bit integer that represents the total number of elements in all the dimensions of the Array.
Public propertyLongLength
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the Array.
Top
See Also