mscorlib(4.0.0.0) API with additions
System.Array Class Reference

Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.To browse the .NET Framework source code for this type, see the Reference Source. More...

Inheritance diagram for System.Array:
[legend]
Collaboration diagram for System.Array:
[legend]

Public Member Functions

static void Clear (Array array, int index, int length)
 Sets a range of elements in an array to the default value of each element type. More...
 
unsafe object GetValue (params int[] indices)
 Gets the value at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 32-bit integers. More...
 
unsafe object GetValue (int index)
 Gets the value at the specified position in the one-dimensional T:System.Array. The index is specified as a 32-bit integer. More...
 
unsafe object GetValue (int index1, int index2)
 Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are specified as 32-bit integers. More...
 
unsafe object GetValue (int index1, int index2, int index3)
 Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are specified as 32-bit integers. More...
 
object GetValue (long index)
 Gets the value at the specified position in the one-dimensional T:System.Array. The index is specified as a 64-bit integer. More...
 
object GetValue (long index1, long index2)
 Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are specified as 64-bit integers. More...
 
object GetValue (long index1, long index2, long index3)
 Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are specified as 64-bit integers. More...
 
object GetValue (params long[] indices)
 Gets the value at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 64-bit integers. More...
 
unsafe void SetValue (object value, int index)
 Sets a value to the element at the specified position in the one-dimensional T:System.Array. The index is specified as a 32-bit integer. More...
 
unsafe void SetValue (object value, int index1, int index2)
 Sets a value to the element at the specified position in the two-dimensional T:System.Array. The indexes are specified as 32-bit integers. More...
 
unsafe void SetValue (object value, int index1, int index2, int index3)
 Sets a value to the element at the specified position in the three-dimensional T:System.Array. The indexes are specified as 32-bit integers. More...
 
unsafe void SetValue (object value, params int[] indices)
 Sets a value to the element at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 32-bit integers. More...
 
void SetValue (object value, long index)
 Sets a value to the element at the specified position in the one-dimensional T:System.Array. The index is specified as a 64-bit integer. More...
 
void SetValue (object value, long index1, long index2)
 Sets a value to the element at the specified position in the two-dimensional T:System.Array. The indexes are specified as 64-bit integers. More...
 
void SetValue (object value, long index1, long index2, long index3)
 Sets a value to the element at the specified position in the three-dimensional T:System.Array. The indexes are specified as 64-bit integers. More...
 
void SetValue (object value, params long[] indices)
 Sets a value to the element at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 64-bit integers. More...
 
int GetLength (int dimension)
 Gets a 32-bit integer that represents the number of elements in the specified dimension of the T:System.Array. More...
 
long GetLongLength (int dimension)
 Gets a 64-bit integer that represents the number of elements in the specified dimension of the T:System.Array. More...
 
int GetUpperBound (int dimension)
 Gets the index of the last element of the specified dimension in the array. More...
 
int GetLowerBound (int dimension)
 Gets the index of the first element of the specified dimension in the array. More...
 
object Clone ()
 Creates a shallow copy of the T:System.Array. More...
 
void CopyTo (Array array, int index)
 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. More...
 
void CopyTo (Array array, long index)
 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. More...
 
IEnumerator GetEnumerator ()
 Returns an T:System.Collections.IEnumerator for the T:System.Array. More...
 
void Initialize ()
 Initializes every element of the value-type T:System.Array by calling the default constructor of the value type. More...
 

Static Public Member Functions

static ReadOnlyCollection< TAsReadOnly< T > (T[] array)
 Returns a read-only wrapper for the specified array. More...
 
static void Resize< T > (ref T[] array, int newSize)
 Changes the number of elements of a one-dimensional array to the specified new size. More...
 
static unsafe Array CreateInstance (Type elementType, int length)
 Creates a one-dimensional T:System.Array of the specified T:System.Type and length, with zero-based indexing. More...
 
static unsafe Array CreateInstance (Type elementType, int length1, int length2)
 Creates a two-dimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. More...
 
static unsafe Array CreateInstance (Type elementType, int length1, int length2, int length3)
 Creates a three-dimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. More...
 
static unsafe Array CreateInstance (Type elementType, params int[] lengths)
 Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers. More...
 
static Array CreateInstance (Type elementType, params long[] lengths)
 Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers. More...
 
static unsafe Array CreateInstance (Type elementType, int[] lengths, int[] lowerBounds)
 Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with the specified lower bounds. More...
 
static void Copy (Array sourceArray, Array destinationArray, int length)
 Copies a range of elements from an T:System.Array starting at the first element and pastes them into another T:System.Array starting at the first element. The length is specified as a 32-bit integer. More...
 
static void Copy (Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
 Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. The length and the indexes are specified as 32-bit integers. More...
 
static void ConstrainedCopy (Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
 Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely. More...
 
static void Copy (Array sourceArray, Array destinationArray, long length)
 Copies a range of elements from an T:System.Array starting at the first element and pastes them into another T:System.Array starting at the first element. The length is specified as a 64-bit integer. More...
 
static void Copy (Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length)
 Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. The length and the indexes are specified as 64-bit integers. More...
 
static int BinarySearch (Array array, object value)
 Searches an entire one-dimensional sorted array for a specific element, using the T:System.IComparable interface implemented by each element of the array and by the specified object. More...
 
static int BinarySearch (Array array, int index, int length, object value)
 Searches a range of elements in a one-dimensional sorted array for a value, using the T:System.IComparable interface implemented by each element of the array and by the specified value. More...
 
static int BinarySearch (Array array, object value, IComparer comparer)
 Searches an entire one-dimensional sorted array for a value using the specified T:System.Collections.IComparer interface. More...
 
static int BinarySearch (Array array, int index, int length, object value, IComparer comparer)
 Searches a range of elements in a one-dimensional sorted array for a value, using the specified T:System.Collections.IComparer interface. More...
 
static int BinarySearch< T > (T[] array, T value)
 Searches an entire one-dimensional sorted array for a specific element, using the T:System.IComparable`1 generic interface implemented by each element of the T:System.Array and by the specified object. More...
 
static int BinarySearch< T > (T[] array, T value, IComparer< T > comparer)
 Searches an entire one-dimensional sorted array for a value using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static int BinarySearch< T > (T[] array, int index, int length, T value)
 Searches a range of elements in a one-dimensional sorted array for a value, using the T:System.IComparable`1 generic interface implemented by each element of the T:System.Array and by the specified value. More...
 
static int BinarySearch< T > (T[] array, int index, int length, T value, IComparer< T > comparer)
 Searches a range of elements in a one-dimensional sorted array for a value, using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static TOutput [] ConvertAll< TInput, TOutput > (TInput[] array, Converter< TInput, TOutput > converter)
 Converts an array of one type to an array of another type. More...
 
static T [] Empty< T > ()
 Returns an empty array. More...
 
static bool Exists< T > (T[] array, Predicate< T > match)
 Determines whether the specified array contains elements that match the conditions defined by the specified predicate. More...
 
static T Find< T > (T[] array, Predicate< T > match)
 Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire T:System.Array. More...
 
static T [] FindAll< T > (T[] array, Predicate< T > match)
 Retrieves all the elements that match the conditions defined by the specified predicate. More...
 
static int FindIndex< T > (T[] array, Predicate< T > match)
 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 T:System.Array. More...
 
static int FindIndex< T > (T[] array, int startIndex, Predicate< T > match)
 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 T:System.Array that extends from the specified index to the last element. More...
 
static int FindIndex< T > (T[] array, int startIndex, int count, Predicate< T > match)
 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 T:System.Array that starts at the specified index and contains the specified number of elements. More...
 
static T FindLast< T > (T[] array, Predicate< T > match)
 Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire T:System.Array. More...
 
static int FindLastIndex< T > (T[] array, Predicate< T > match)
 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 T:System.Array. More...
 
static int FindLastIndex< T > (T[] array, int startIndex, Predicate< T > match)
 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 T:System.Array that extends from the first element to the specified index. More...
 
static int FindLastIndex< T > (T[] array, int startIndex, int count, Predicate< T > match)
 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 T:System.Array that contains the specified number of elements and ends at the specified index. More...
 
static void ForEach< T > (T[] array, Action< T > action)
 Performs the specified action on each element of the specified array. More...
 
static int IndexOf (Array array, object value)
 Searches for the specified object and returns the index of its first occurrence in a one-dimensional array. More...
 
static int IndexOf (Array array, object value, int startIndex)
 Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array. More...
 
static int IndexOf (Array array, object value, int startIndex, int count)
 Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of ifs first occurrence. The range extends from a specified index for a specified number of elements. More...
 
static int IndexOf< T > (T[] array, T value)
 Searches for the specified object and returns the index of its first occurrence in a one-dimensional array. More...
 
static int IndexOf< T > (T[] array, T value, int startIndex)
 Searches for the specified object in a range of elements of a one dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array. More...
 
static int IndexOf< T > (T[] array, T value, int startIndex, int count)
 Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index for a specified number of elements. More...
 
static int LastIndexOf (Array array, object value)
 Searches for the specified object and returns the index of the last occurrence within the entire one-dimensional T:System.Array. More...
 
static int LastIndexOf (Array array, object value, int startIndex)
 Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional T:System.Array that extends from the first element to the specified index. More...
 
static int LastIndexOf (Array array, object value, int startIndex, int count)
 Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional T:System.Array that contains the specified number of elements and ends at the specified index. More...
 
static int LastIndexOf< T > (T[] array, T value)
 Searches for the specified object and returns the index of the last occurrence within the entire T:System.Array. More...
 
static int LastIndexOf< T > (T[] array, T value, int startIndex)
 Searches for the specified object and returns the index of the last occurrence within the range of elements in the T:System.Array that extends from the first element to the specified index. More...
 
static int LastIndexOf< T > (T[] array, T value, int startIndex, int count)
 Searches for the specified object and returns the index of the last occurrence within the range of elements in the T:System.Array that contains the specified number of elements and ends at the specified index. More...
 
static void Reverse (Array array)
 Reverses the sequence of the elements in the entire one-dimensional T:System.Array. More...
 
static void Reverse (Array array, int index, int length)
 Reverses the sequence of the elements in a range of elements in the one-dimensional T:System.Array. More...
 
static void Sort (Array array)
 Sorts the elements in an entire one-dimensional T:System.Array using the T:System.IComparable implementation of each element of the T:System.Array. More...
 
static void Sort (Array keys, Array items)
 Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable implementation of each key. More...
 
static void Sort (Array array, int index, int length)
 Sorts the elements in a range of elements in a one-dimensional T:System.Array using the T:System.IComparable implementation of each element of the T:System.Array. More...
 
static void Sort (Array keys, Array items, int index, int length)
 Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable implementation of each key. More...
 
static void Sort (Array array, IComparer comparer)
 Sorts the elements in a one-dimensional T:System.Array using the specified T:System.Collections.IComparer. More...
 
static void Sort (Array keys, Array items, IComparer comparer)
 Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.IComparer. More...
 
static void Sort (Array array, int index, int length, IComparer comparer)
 Sorts the elements in a range of elements in a one-dimensional T:System.Array using the specified T:System.Collections.IComparer. More...
 
static void Sort (Array keys, Array items, int index, int length, IComparer comparer)
 Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.IComparer. More...
 
static void Sort< T > (T[] array)
 Sorts the elements in an entire T:System.Array using the T:System.IComparable`1 generic interface implementation of each element of the T:System.Array. More...
 
static void Sort< TKey, TValue > (TKey[] keys, TValue[] items)
 Sorts a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable`1 generic interface implementation of each key. More...
 
static void Sort< T > (T[] array, int index, int length)
 Sorts the elements in a range of elements in an T:System.Array using the T:System.IComparable`1 generic interface implementation of each element of the T:System.Array. More...
 
static void Sort< TKey, TValue > (TKey[] keys, TValue[] items, int index, int length)
 Sorts a range of elements in a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable`1 generic interface implementation of each key. More...
 
static void Sort< T > (T[] array, IComparer< T > comparer)
 Sorts the elements in an T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static void Sort< TKey, TValue > (TKey[] keys, TValue[] items, IComparer< TKey > comparer)
 Sorts a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static void Sort< T > (T[] array, int index, int length, IComparer< T > comparer)
 Sorts the elements in a range of elements in an T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static void Sort< TKey, TValue > (TKey[] keys, TValue[] items, int index, int length, IComparer< TKey > comparer)
 Sorts a range of elements in a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface. More...
 
static void Sort< T > (T[] array, Comparison< T > comparison)
 Sorts the elements in an T:System.Array using the specified T:System.Comparison`1. More...
 
static bool TrueForAll< T > (T[] array, Predicate< T > match)
 Determines whether every element in the array matches the conditions defined by the specified predicate. More...
 

Public Attributes

object SyncRoot => this
 Gets an object that can be used to synchronize access to the T:System.Array. More...
 
bool IsReadOnly => false
 Gets a value indicating whether the T:System.Array is read-only. More...
 
bool IsFixedSize => true
 Gets a value indicating whether the T:System.Array has a fixed size. More...
 
bool IsSynchronized => false
 Gets a value indicating whether access to the T:System.Array is synchronized (thread safe). More...
 

Properties

int Length [get]
 Gets the total number of elements in all the dimensions of the T:System.Array. More...
 
long LongLength [get]
 Gets a 64-bit integer that represents the total number of elements in all the dimensions of the T:System.Array. More...
 
int Rank [get]
 Gets the rank (number of dimensions) of the T:System.Array. For example, a one-dimensional array returns 1, a two-dimensional array returns 2, and so on. More...
 
- Properties inherited from System.Collections.IList
object this[int index] [get, set]
 Gets or sets the element at the specified index. More...
 
bool IsReadOnly [get]
 Gets a value indicating whether the T:System.Collections.IList is read-only. More...
 
bool IsFixedSize [get]
 Gets a value indicating whether the T:System.Collections.IList has a fixed size. More...
 
- Properties inherited from System.Collections.ICollection
int Count [get]
 Gets the number of elements contained in the T:System.Collections.ICollection. More...
 
object SyncRoot [get]
 Gets an object that can be used to synchronize access to the T:System.Collections.ICollection. More...
 
bool IsSynchronized [get]
 Gets a value indicating whether access to the T:System.Collections.ICollection is synchronized (thread safe). More...
 

Detailed Description

Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.To browse the .NET Framework source code for this type, see the Reference Source.

Definition at line 17 of file Array.cs.

Member Function Documentation

◆ AsReadOnly< T >()

static ReadOnlyCollection<T> System.Array.AsReadOnly< T > ( T []  array)
static

Returns a read-only wrapper for the specified array.

Parameters
arrayThe one-dimensional, zero-based array to wrap in a read-only T:System.Collections.ObjectModel.ReadOnlyCollection`1 wrapper.
Template Parameters
TThe type of the elements of the array.
Returns
A read-only T:System.Collections.ObjectModel.ReadOnlyCollection`1 wrapper for the specified array.
Exceptions
T:System.ArgumentNullExceptionarray is null.

Definition at line 920 of file Array.cs.

◆ BinarySearch() [1/4]

static int System.Array.BinarySearch ( Array  array,
object  value 
)
static

Searches an entire one-dimensional sorted array for a specific element, using the T:System.IComparable interface implemented by each element of the array and by the specified object.

Parameters
arrayThe sorted one-dimensional T:System.Array to search.
valueThe object to search for.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentExceptionvalue is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptionvalue does not implement the T:System.IComparable interface, and the search encounters an element that does not implement the T:System.IComparable interface.

Definition at line 2060 of file Array.cs.

◆ BinarySearch() [2/4]

static int System.Array.BinarySearch ( Array  array,
int  index,
int  length,
object  value 
)
static

Searches a range of elements in a one-dimensional sorted array for a value, using the T:System.IComparable interface implemented by each element of the array and by the specified value.

Parameters
arrayThe sorted one-dimensional T:System.Array to search.
indexThe starting index of the range to search.
lengthThe length of the range to search.
valueThe object to search for.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .-or- value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptionvalue does not implement the T:System.IComparable interface, and the search encounters an element that does not implement the T:System.IComparable interface.

Definition at line 2090 of file Array.cs.

◆ BinarySearch() [3/4]

static int System.Array.BinarySearch ( Array  array,
object  value,
IComparer  comparer 
)
static

Searches an entire one-dimensional sorted array for a value using the specified T:System.Collections.IComparer interface.

Parameters
arrayThe sorted one-dimensional T:System.Array to search.
valueThe object to search for.
comparerThe T:System.Collections.IComparer implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentExceptioncomparer is null, and value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptioncomparer is null, value does not implement the T:System.IComparable interface, and the search encounters an element that does not implement the T:System.IComparable interface.

Definition at line 2111 of file Array.cs.

◆ BinarySearch() [4/4]

static int System.Array.BinarySearch ( Array  array,
int  index,
int  length,
object  value,
IComparer  comparer 
)
static

Searches a range of elements in a one-dimensional sorted array for a value, using the specified T:System.Collections.IComparer interface.

Parameters
arrayThe sorted one-dimensional T:System.Array to search.
indexThe starting index of the range to search.
lengthThe length of the range to search.
valueThe object to search for.
comparerThe T:System.Collections.IComparer implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .-or- comparer is null, and value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptioncomparer is null, value does not implement the T:System.IComparable interface, and the search encounters an element that does not implement the T:System.IComparable interface.

Definition at line 2144 of file Array.cs.

◆ BinarySearch< T >() [1/4]

static int System.Array.BinarySearch< T > ( T []  array,
T  value 
)
static

Searches an entire one-dimensional sorted array for a specific element, using the T:System.IComparable`1 generic interface implemented by each element of the T:System.Array and by the specified object.

Parameters
arrayThe sorted one-dimensional, zero-based T:System.Array to search.
valueThe object to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.InvalidOperationExceptionT does not implement the T:System.IComparable`1 generic interface.

Definition at line 2249 of file Array.cs.

◆ BinarySearch< T >() [2/4]

static int System.Array.BinarySearch< T > ( T []  array,
T  value,
IComparer< T comparer 
)
static

Searches an entire one-dimensional sorted array for a value using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
arrayThe sorted one-dimensional, zero-based T:System.Array to search.
valueThe object to search for.
comparerThe T:System.Collections.Generic.IComparer`1 implementation to use when comparing elements.-or- null to use the T:System.IComparable`1 implementation of each element.
Template Parameters
TThe type of the elements of the array.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentExceptioncomparer is null, and value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptioncomparer is null, and T does not implement the T:System.IComparable`1 generic interface

Definition at line 2273 of file Array.cs.

◆ BinarySearch< T >() [3/4]

static int System.Array.BinarySearch< T > ( T []  array,
int  index,
int  length,
T  value 
)
static

Searches a range of elements in a one-dimensional sorted array for a value, using the T:System.IComparable`1 generic interface implemented by each element of the T:System.Array and by the specified value.

Parameters
arrayThe sorted one-dimensional, zero-based T:System.Array to search.
indexThe starting index of the range to search.
lengthThe length of the range to search.
valueThe object to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .-or- value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptionT does not implement the T:System.IComparable`1 generic interface.

Definition at line 2301 of file Array.cs.

◆ BinarySearch< T >() [4/4]

static int System.Array.BinarySearch< T > ( T []  array,
int  index,
int  length,
T  value,
IComparer< T comparer 
)
static

Searches a range of elements in a one-dimensional sorted array for a value, using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
arrayThe sorted one-dimensional, zero-based T:System.Array to search.
indexThe starting index of the range to search.
lengthThe length of the range to search.
valueThe object to search for.
comparerThe T:System.Collections.Generic.IComparer`1 implementation to use when comparing elements.-or- null to use the T:System.IComparable`1 implementation of each element.
Template Parameters
TThe type of the elements of the array.
Returns
The index of the specified value in the specified array , if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array , the negative number returned is the bitwise complement of the index of the first element that is larger than value . If value is not found and value is greater than all elements in array , the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array , the return value can be incorrect and a negative number could be returned, even if value is present in array .
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .-or- comparer is null, and value is of a type that is not compatible with the elements of array .
T:System.InvalidOperationExceptioncomparer is null, and T does not implement the T:System.IComparable`1 generic interface.

Definition at line 2327 of file Array.cs.

◆ Clear()

static void System.Array.Clear ( Array  array,
int  index,
int  length 
)

Sets a range of elements in an array to the default value of each element type.

Parameters
arrayThe array whose elements need to be cleared.
indexThe starting index of the range of elements to clear.
lengthThe number of elements to clear.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.IndexOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.-or-The sum of index and length is greater than the size of array .

◆ Clone()

object System.Array.Clone ( )

Creates a shallow copy of the T:System.Array.

Returns
A shallow copy of the T:System.Array.

Implements System.ICloneable.

Definition at line 1954 of file Array.cs.

◆ ConstrainedCopy()

static void System.Array.ConstrainedCopy ( Array  sourceArray,
int  sourceIndex,
Array  destinationArray,
int  destinationIndex,
int  length 
)
static

Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely.

Parameters
sourceArrayThe T:System.Array that contains the data to copy.
sourceIndexA 32-bit integer that represents the index in the sourceArray at which copying begins.
destinationArrayThe T:System.Array that receives the data.
destinationIndexA 32-bit integer that represents the index in the destinationArray at which storing begins.
lengthA 32-bit integer that represents the number of elements to copy.
Exceptions
T:System.ArgumentNullExceptionsourceArray is null.-or- destinationArray is null.
T:System.RankExceptionsourceArray and destinationArray have different ranks.
T:System.ArrayTypeMismatchExceptionThe sourceArray type is neither the same as nor derived from the destinationArray type.
T:System.InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray .
T:System.ArgumentOutOfRangeExceptionsourceIndex is less than the lower bound of the first dimension of sourceArray .-or- destinationIndex is less than the lower bound of the first dimension of destinationArray .-or- length is less than zero.
T:System.ArgumentExceptionlength is greater than the number of elements from sourceIndex to the end of sourceArray .-or- length is greater than the number of elements from destinationIndex to the end of destinationArray .

Definition at line 1345 of file Array.cs.

◆ ConvertAll< TInput, TOutput >()

static TOutput [] System.Array.ConvertAll< TInput, TOutput > ( TInput []  array,
Converter< TInput, TOutput >  converter 
)
static

Converts an array of one type to an array of another type.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to convert to a target type.
converterA T:System.Converter`2 that converts each element from one type to another type.
Template Parameters
TInputThe type of the elements of the source array.
TOutputThe type of the elements of the target array.
Returns
An array of the target type containing the converted elements from the source array.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- converter is null.

Definition at line 2353 of file Array.cs.

◆ Copy() [1/4]

static void System.Array.Copy ( Array  sourceArray,
Array  destinationArray,
int  length 
)
static

Copies a range of elements from an T:System.Array starting at the first element and pastes them into another T:System.Array starting at the first element. The length is specified as a 32-bit integer.

Parameters
sourceArrayThe T:System.Array that contains the data to copy.
destinationArrayThe T:System.Array that receives the data.
lengthA 32-bit integer that represents the number of elements to copy.
Exceptions
T:System.ArgumentNullExceptionsourceArray is null.-or- destinationArray is null.
T:System.RankExceptionsourceArray and destinationArray have different ranks.
T:System.ArrayTypeMismatchExceptionsourceArray and destinationArray are of incompatible types.
T:System.InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray .
T:System.ArgumentOutOfRangeExceptionlength is less than zero.
T:System.ArgumentExceptionlength is greater than the number of elements in sourceArray .-or- length is greater than the number of elements in destinationArray .

Definition at line 1275 of file Array.cs.

◆ Copy() [2/4]

static void System.Array.Copy ( Array  sourceArray,
int  sourceIndex,
Array  destinationArray,
int  destinationIndex,
int  length 
)
static

Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. The length and the indexes are specified as 32-bit integers.

Parameters
sourceArrayThe T:System.Array that contains the data to copy.
sourceIndexA 32-bit integer that represents the index in the sourceArray at which copying begins.
destinationArrayThe T:System.Array that receives the data.
destinationIndexA 32-bit integer that represents the index in the destinationArray at which storing begins.
lengthA 32-bit integer that represents the number of elements to copy.
Exceptions
T:System.ArgumentNullExceptionsourceArray is null.-or- destinationArray is null.
T:System.RankExceptionsourceArray and destinationArray have different ranks.
T:System.ArrayTypeMismatchExceptionsourceArray and destinationArray are of incompatible types.
T:System.InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray .
T:System.ArgumentOutOfRangeExceptionsourceIndex is less than the lower bound of the first dimension of sourceArray .-or- destinationIndex is less than the lower bound of the first dimension of destinationArray .-or- length is less than zero.
T:System.ArgumentExceptionlength is greater than the number of elements from sourceIndex to the end of sourceArray .-or- length is greater than the number of elements from destinationIndex to the end of destinationArray .

Definition at line 1312 of file Array.cs.

◆ Copy() [3/4]

static void System.Array.Copy ( Array  sourceArray,
Array  destinationArray,
long  length 
)
static

Copies a range of elements from an T:System.Array starting at the first element and pastes them into another T:System.Array starting at the first element. The length is specified as a 64-bit integer.

Parameters
sourceArrayThe T:System.Array that contains the data to copy.
destinationArrayThe T:System.Array that receives the data.
lengthA 64-bit integer that represents the number of elements to copy. The integer must be between zero and F:System.Int32.MaxValue, inclusive.
Exceptions
T:System.ArgumentNullExceptionsourceArray is null.-or- destinationArray is null.
T:System.RankExceptionsourceArray and destinationArray have different ranks.
T:System.ArrayTypeMismatchExceptionsourceArray and destinationArray are of incompatible types.
T:System.InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray .
T:System.ArgumentOutOfRangeExceptionlength is less than 0 or greater than F:System.Int32.MaxValue.
T:System.ArgumentExceptionlength is greater than the number of elements in sourceArray .-or- length is greater than the number of elements in destinationArray .

Definition at line 1368 of file Array.cs.

◆ Copy() [4/4]

static void System.Array.Copy ( Array  sourceArray,
long  sourceIndex,
Array  destinationArray,
long  destinationIndex,
long  length 
)
static

Copies a range of elements from an T:System.Array starting at the specified source index and pastes them to another T:System.Array starting at the specified destination index. The length and the indexes are specified as 64-bit integers.

Parameters
sourceArrayThe T:System.Array that contains the data to copy.
sourceIndexA 64-bit integer that represents the index in the sourceArray at which copying begins.
destinationArrayThe T:System.Array that receives the data.
destinationIndexA 64-bit integer that represents the index in the destinationArray at which storing begins.
lengthA 64-bit integer that represents the number of elements to copy. The integer must be between zero and F:System.Int32.MaxValue, inclusive.
Exceptions
T:System.ArgumentNullExceptionsourceArray is null.-or- destinationArray is null.
T:System.RankExceptionsourceArray and destinationArray have different ranks.
T:System.ArrayTypeMismatchExceptionsourceArray and destinationArray are of incompatible types.
T:System.InvalidCastExceptionAt least one element in sourceArray cannot be cast to the type of destinationArray .
T:System.ArgumentOutOfRangeExceptionsourceIndex is outside the range of valid indexes for the sourceArray .-or- destinationIndex is outside the range of valid indexes for the destinationArray .-or- length is less than 0 or greater than F:System.Int32.MaxValue.
T:System.ArgumentExceptionlength is greater than the number of elements from sourceIndex to the end of sourceArray .-or- length is greater than the number of elements from destinationIndex to the end of destinationArray .

Definition at line 1399 of file Array.cs.

◆ CopyTo() [1/2]

void System.Array.CopyTo ( Array  array,
int  index 
)

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.

Parameters
arrayThe one-dimensional array that is the destination of the elements copied from the current array.
indexA 32-bit integer that represents the index in array at which copying begins.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .
T:System.ArgumentExceptionarray is multidimensional.-or-The number of elements in the source array is greater than the available number of elements from index to the end of the destination array .
T:System.ArrayTypeMismatchExceptionThe type of the source T:System.Array cannot be cast automatically to the type of the destination array .
T:System.RankExceptionThe source array is multidimensional.
T:System.InvalidCastExceptionAt least one element in the source T:System.Array cannot be cast to the type of destination array .

Implements System.Collections.ICollection.

Definition at line 2384 of file Array.cs.

◆ CopyTo() [2/2]

void System.Array.CopyTo ( Array  array,
long  index 
)

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.

Parameters
arrayThe one-dimensional array that is the destination of the elements copied from the current array.
indexA 64-bit integer that represents the index in array at which copying begins.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is outside the range of valid indexes for array .
T:System.ArgumentExceptionarray is multidimensional.-or-The number of elements in the source array is greater than the available number of elements from index to the end of the destination array .
T:System.ArrayTypeMismatchExceptionThe type of the source T:System.Array cannot be cast automatically to the type of the destination array .
T:System.RankExceptionThe source T:System.Array is multidimensional.
T:System.InvalidCastExceptionAt least one element in the source T:System.Array cannot be cast to the type of destination array .

Definition at line 2406 of file Array.cs.

◆ CreateInstance() [1/6]

static unsafe Array System.Array.CreateInstance ( Type  elementType,
int  length 
)
static

Creates a one-dimensional T:System.Array of the specified T:System.Type and length, with zero-based indexing.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
lengthThe size of the T:System.Array to create.
Returns
A new one-dimensional T:System.Array of the specified T:System.Type with the specified length, using zero-based indexing.
Exceptions
T:System.ArgumentNullExceptionelementType is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported.-or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionlength is less than zero.

Definition at line 972 of file Array.cs.

◆ CreateInstance() [2/6]

static unsafe Array System.Array.CreateInstance ( Type  elementType,
int  length1,
int  length2 
)
static

Creates a two-dimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
length1The size of the first dimension of the T:System.Array to create.
length2The size of the second dimension of the T:System.Array to create.
Returns
A new two-dimensional T:System.Array of the specified T:System.Type with the specified length for each dimension, using zero-based indexing.
Exceptions
T:System.ArgumentNullExceptionelementType is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported. -or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionlength1 is less than zero.-or- length2 is less than zero.

Definition at line 1007 of file Array.cs.

◆ CreateInstance() [3/6]

static unsafe Array System.Array.CreateInstance ( Type  elementType,
int  length1,
int  length2,
int  length3 
)
static

Creates a three-dimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
length1The size of the first dimension of the T:System.Array to create.
length2The size of the second dimension of the T:System.Array to create.
length3The size of the third dimension of the T:System.Array to create.
Returns
A new three-dimensional T:System.Array of the specified T:System.Type with the specified length for each dimension, using zero-based indexing.
Exceptions
T:System.ArgumentNullExceptionelementType is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported. -or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionlength1 is less than zero.-or- length2 is less than zero.-or- length3 is less than zero.

Definition at line 1047 of file Array.cs.

◆ CreateInstance() [4/6]

static unsafe Array System.Array.CreateInstance ( Type  elementType,
params int []  lengths 
)
static

Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
lengthsAn array of 32-bit integers that represent the size of each dimension of the T:System.Array to create.
Returns
A new multidimensional T:System.Array of the specified T:System.Type with the specified length for each dimension, using zero-based indexing.
Exceptions
T:System.ArgumentNullExceptionelementType is null.-or- lengths is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.-or-The lengths array contains less than one element.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported. -or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionAny value in lengths is less than zero.

Definition at line 1093 of file Array.cs.

◆ CreateInstance() [5/6]

static Array System.Array.CreateInstance ( Type  elementType,
params long []  lengths 
)
static

Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
lengthsAn array of 64-bit integers that represent the size of each dimension of the T:System.Array to create. Each integer in the array must be between zero and F:System.Int32.MaxValue, inclusive.
Returns
A new multidimensional T:System.Array of the specified T:System.Type with the specified length for each dimension, using zero-based indexing.
Exceptions
T:System.ArgumentNullExceptionelementType is null.-or- lengths is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.-or-The lengths array contains less than one element.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported. -or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionAny value in lengths is less than zero or greater than F:System.Int32.MaxValue.

Definition at line 1139 of file Array.cs.

◆ CreateInstance() [6/6]

static unsafe Array System.Array.CreateInstance ( Type  elementType,
int []  lengths,
int []  lowerBounds 
)
static

Creates a multidimensional T:System.Array of the specified T:System.Type and dimension lengths, with the specified lower bounds.

Parameters
elementTypeThe T:System.Type of the T:System.Array to create.
lengthsA one-dimensional array that contains the size of each dimension of the T:System.Array to create.
lowerBoundsA one-dimensional array that contains the lower bound (starting index) of each dimension of the T:System.Array to create.
Returns
A new multidimensional T:System.Array of the specified T:System.Type with the specified length and lower bound for each dimension.
Exceptions
T:System.ArgumentNullExceptionelementType is null.-or- lengths is null.-or- lowerBounds is null.
T:System.ArgumentExceptionelementType is not a valid T:System.Type.-or-The lengths array contains less than one element.-or-The lengths and lowerBounds arrays do not contain the same number of elements.
T:System.NotSupportedExceptionelementType is not supported. For example, T:System.Void is not supported. -or-

elementType is an open generic type.

Exceptions
T:System.ArgumentOutOfRangeExceptionAny value in lengths is less than zero.-or-Any value in lowerBounds is very large, such that the sum of a dimension's lower bound and length is greater than F:System.Int32.MaxValue.

Definition at line 1180 of file Array.cs.

◆ Empty< T >()

static T [] System.Array.Empty< T > ( )
static

Returns an empty array.

Template Parameters
TThe type of the elements of the array.
Returns
Returns an empty T:System.Array.

Definition at line 2420 of file Array.cs.

◆ Exists< T >()

static bool System.Array.Exists< T > ( T []  array,
Predicate< T match 
)
static

Determines whether the specified array contains elements that match the conditions defined by the specified predicate.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
matchThe T:System.Predicate`1 that defines the conditions of the elements to search for.
Template Parameters
TThe type of the elements of the array.
Returns
true if array contains one or more elements that match the conditions defined by the specified predicate; otherwise, false.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2435 of file Array.cs.

◆ Find< T >()

static T System.Array.Find< T > ( T []  array,
Predicate< T match 
)
static

Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire T:System.Array.

Parameters
arrayThe one-dimensional, zero-based array to search.
matchThe predicate that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T .
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2449 of file Array.cs.

◆ FindAll< T >()

static T [] System.Array.FindAll< T > ( T []  array,
Predicate< T match 
)
static

Retrieves all the elements that match the conditions defined by the specified predicate.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
matchThe T:System.Predicate`1 that defines the conditions of the elements to search for.
Template Parameters
TThe type of the elements of the array.
Returns
An T:System.Array containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty T:System.Array.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2478 of file Array.cs.

◆ FindIndex< T >() [1/3]

static int System.Array.FindIndex< T > ( T []  array,
Predicate< T match 
)
static

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 T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2508 of file Array.cs.

◆ FindIndex< T >() [2/3]

static int System.Array.FindIndex< T > ( T []  array,
int  startIndex,
Predicate< T match 
)
static

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 T:System.Array that extends from the specified index to the last element.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
startIndexThe zero-based starting index of the search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .

Definition at line 2529 of file Array.cs.

◆ FindIndex< T >() [3/3]

static int System.Array.FindIndex< T > ( T []  array,
int  startIndex,
int  count,
Predicate< T match 
)
static

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 T:System.Array that starts at the specified index and contains the specified number of elements.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
startIndexThe zero-based starting index of the search.
countThe number of elements in the section to search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of an element that matches the conditions defined by match , if found; otherwise, -1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .

Definition at line 2553 of file Array.cs.

◆ FindLast< T >()

static T System.Array.FindLast< T > ( T []  array,
Predicate< T match 
)
static

Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T .
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2591 of file Array.cs.

◆ FindLastIndex< T >() [1/3]

static int System.Array.FindLastIndex< T > ( T []  array,
Predicate< T match 
)
static

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 T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 2620 of file Array.cs.

◆ FindLastIndex< T >() [2/3]

static int System.Array.FindLastIndex< T > ( T []  array,
int  startIndex,
Predicate< T match 
)
static

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 T:System.Array that extends from the first element to the specified index.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
startIndexThe zero-based starting index of the backward search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .

Definition at line 2641 of file Array.cs.

◆ FindLastIndex< T >() [3/3]

static int System.Array.FindLastIndex< T > ( T []  array,
int  startIndex,
int  count,
Predicate< T match 
)
static

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 T:System.Array that contains the specified number of elements and ends at the specified index.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
matchThe T:System.Predicate`1 that defines the conditions of the element to search for.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of an element that matches the conditions defined by match , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .

Definition at line 2665 of file Array.cs.

◆ ForEach< T >()

static void System.Array.ForEach< T > ( T []  array,
Action< T action 
)
static

Performs the specified action on each element of the specified array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array on whose elements the action is to be performed.
actionThe T:System.Action`1 to perform on each element of array .
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- action is null.

Definition at line 2708 of file Array.cs.

◆ GetEnumerator()

IEnumerator System.Array.GetEnumerator ( )

Returns an T:System.Collections.IEnumerator for the T:System.Array.

Returns
An T:System.Collections.IEnumerator for the T:System.Array.

Implements System.Collections.IEnumerable.

Definition at line 2727 of file Array.cs.

◆ GetLength()

int System.Array.GetLength ( int  dimension)

Gets a 32-bit integer that represents the number of elements in the specified dimension of the T:System.Array.

Parameters
dimensionA zero-based dimension of the T:System.Array whose length needs to be determined.
Returns
A 32-bit integer that represents the number of elements in the specified dimension.
Exceptions
T:System.IndexOutOfRangeExceptiondimension is less than zero.-or- dimension is equal to or greater than P:System.Array.Rank.

◆ GetLongLength()

long System.Array.GetLongLength ( int  dimension)

Gets a 64-bit integer that represents the number of elements in the specified dimension of the T:System.Array.

Parameters
dimensionA zero-based dimension of the T:System.Array whose length needs to be determined.
Returns
A 64-bit integer that represents the number of elements in the specified dimension.
Exceptions
T:System.IndexOutOfRangeExceptiondimension is less than zero.-or- dimension is equal to or greater than P:System.Array.Rank.

Definition at line 1847 of file Array.cs.

◆ GetLowerBound()

int System.Array.GetLowerBound ( int  dimension)

Gets the index of the first element of the specified dimension in the array.

Parameters
dimensionA zero-based dimension of the array whose starting index needs to be determined.
Returns
The index of the first element of the specified dimension in the array.
Exceptions
T:System.IndexOutOfRangeExceptiondimension is less than zero.-or- dimension is equal to or greater than P:System.Array.Rank.

◆ GetUpperBound()

int System.Array.GetUpperBound ( int  dimension)

Gets the index of the last element of the specified dimension in the array.

Parameters
dimensionA zero-based dimension of the array whose upper bound needs to be determined.
Returns
The index of the last element of the specified dimension in the array, or -1 if the specified dimension is empty.
Exceptions
T:System.IndexOutOfRangeExceptiondimension is less than zero.-or- dimension is equal to or greater than P:System.Array.Rank.

◆ GetValue() [1/8]

unsafe object System.Array.GetValue ( params int []  indices)

Gets the value at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 32-bit integers.

Parameters
indicesA one-dimensional array of 32-bit integers that represent the indexes specifying the position of the T:System.Array element to get.
Returns
The value at the specified position in the multidimensional T:System.Array.
Exceptions
T:System.ArgumentNullExceptionindices is null.
T:System.ArgumentExceptionThe number of dimensions in the current T:System.Array is not equal to the number of elements in indices .
T:System.IndexOutOfRangeExceptionAny element in indices is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1440 of file Array.cs.

◆ GetValue() [2/8]

unsafe object System.Array.GetValue ( int  index)

Gets the value at the specified position in the one-dimensional T:System.Array. The index is specified as a 32-bit integer.

Parameters
indexA 32-bit integer that represents the position of the T:System.Array element to get.
Returns
The value at the specified position in the one-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly one dimension.
T:System.IndexOutOfRangeExceptionindex is outside the range of valid indexes for the current T:System.Array.

Definition at line 1466 of file Array.cs.

◆ GetValue() [3/8]

unsafe object System.Array.GetValue ( int  index1,
int  index2 
)

Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are specified as 32-bit integers.

Parameters
index1A 32-bit integer that represents the first-dimension index of the T:System.Array element to get.
index2A 32-bit integer that represents the second-dimension index of the T:System.Array element to get.
Returns
The value at the specified position in the two-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly two dimensions.
T:System.IndexOutOfRangeExceptionEither index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1484 of file Array.cs.

◆ GetValue() [4/8]

unsafe object System.Array.GetValue ( int  index1,
int  index2,
int  index3 
)

Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are specified as 32-bit integers.

Parameters
index1A 32-bit integer that represents the first-dimension index of the T:System.Array element to get.
index2A 32-bit integer that represents the second-dimension index of the T:System.Array element to get.
index3A 32-bit integer that represents the third-dimension index of the T:System.Array element to get.
Returns
The value at the specified position in the three-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly three dimensions.
T:System.IndexOutOfRangeExceptionindex1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1507 of file Array.cs.

◆ GetValue() [5/8]

object System.Array.GetValue ( long  index)

Gets the value at the specified position in the one-dimensional T:System.Array. The index is specified as a 64-bit integer.

Parameters
indexA 64-bit integer that represents the position of the T:System.Array element to get.
Returns
The value at the specified position in the one-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly one dimension.
T:System.ArgumentOutOfRangeExceptionindex is outside the range of valid indexes for the current T:System.Array.

Definition at line 1529 of file Array.cs.

◆ GetValue() [6/8]

object System.Array.GetValue ( long  index1,
long  index2 
)

Gets the value at the specified position in the two-dimensional T:System.Array. The indexes are specified as 64-bit integers.

Parameters
index1A 64-bit integer that represents the first-dimension index of the T:System.Array element to get.
index2A 64-bit integer that represents the second-dimension index of the T:System.Array element to get.
Returns
The value at the specified position in the two-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly two dimensions.
T:System.ArgumentOutOfRangeExceptionEither index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1545 of file Array.cs.

◆ GetValue() [7/8]

object System.Array.GetValue ( long  index1,
long  index2,
long  index3 
)

Gets the value at the specified position in the three-dimensional T:System.Array. The indexes are specified as 64-bit integers.

Parameters
index1A 64-bit integer that represents the first-dimension index of the T:System.Array element to get.
index2A 64-bit integer that represents the second-dimension index of the T:System.Array element to get.
index3A 64-bit integer that represents the third-dimension index of the T:System.Array element to get.
Returns
The value at the specified position in the three-dimensional T:System.Array.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly three dimensions.
T:System.ArgumentOutOfRangeExceptionindex1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1567 of file Array.cs.

◆ GetValue() [8/8]

object System.Array.GetValue ( params long []  indices)

Gets the value at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 64-bit integers.

Parameters
indicesA one-dimensional array of 64-bit integers that represent the indexes specifying the position of the T:System.Array element to get.
Returns
The value at the specified position in the multidimensional T:System.Array.
Exceptions
T:System.ArgumentNullExceptionindices is null.
T:System.ArgumentExceptionThe number of dimensions in the current T:System.Array is not equal to the number of elements in indices .
T:System.ArgumentOutOfRangeExceptionAny element in indices is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1592 of file Array.cs.

◆ IndexOf() [1/3]

static int System.Array.IndexOf ( Array  array,
object  value 
)
static

Searches for the specified object and returns the index of its first occurrence in a one-dimensional array.

Parameters
arrayThe one-dimensional array to search.
valueThe object to locate in array .
Returns
The index of the first occurrence of value in array , if found; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.

Definition at line 2747 of file Array.cs.

◆ IndexOf() [2/3]

static int System.Array.IndexOf ( Array  array,
object  value,
int  startIndex 
)
static

Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array.

Parameters
arrayThe one-dimensional array to search.
valueThe object to locate in array .
startIndexThe starting index of the search. 0 (zero) is valid in an empty array.
Returns
The index of the first occurrence of value , if it’s found, within the range of elements in array that extends from startIndex to the last element; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .
T:System.RankExceptionarray is multidimensional.

Definition at line 2770 of file Array.cs.

◆ IndexOf() [3/3]

static int System.Array.IndexOf ( Array  array,
object  value,
int  startIndex,
int  count 
)
static

Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of ifs first occurrence. The range extends from a specified index for a specified number of elements.

Parameters
arrayThe one-dimensional array to search.
valueThe object to locate in array .
startIndexThe starting index of the search. 0 (zero) is valid in an empty array.
countThe number of elements to search.
Returns
The index of the first occurrence of value , if it’s found in the array from index startIndex to startIndex + count - 1; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .
T:System.RankExceptionarray is multidimensional.

Definition at line 2797 of file Array.cs.

◆ IndexOf< T >() [1/3]

static int System.Array.IndexOf< T > ( T []  array,
T  value 
)
static

Searches for the specified object and returns the index of its first occurrence in a one-dimensional array.

Parameters
arrayThe one-dimensional, zero-based array to search.
valueThe object to locate in array .
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of value in the entire array , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.

Definition at line 2875 of file Array.cs.

◆ IndexOf< T >() [2/3]

static int System.Array.IndexOf< T > ( T []  array,
T  value,
int  startIndex 
)
static

Searches for the specified object in a range of elements of a one dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array.

Parameters
arrayThe one-dimensional, zero-based array to search.
valueThe object to locate in array .
startIndexThe zero-based starting index of the search. 0 (zero) is valid in an empty array.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of value within the range of elements in array that extends from startIndex to the last element, if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .

Definition at line 2895 of file Array.cs.

◆ IndexOf< T >() [3/3]

static int System.Array.IndexOf< T > ( T []  array,
T  value,
int  startIndex,
int  count 
)
static

Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index for a specified number of elements.

Parameters
arrayThe one-dimensional, zero-based array to search.
valueThe object to locate in array .
startIndexThe zero-based starting index of the search. 0 (zero) is valid in an empty array.
countThe number of elements in the section to search.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the first occurrence of value within the range of elements in array that starts at startIndex and contains the number of elements specified in count , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .

Definition at line 2918 of file Array.cs.

◆ Initialize()

void System.Array.Initialize ( )

Initializes every element of the value-type T:System.Array by calling the default constructor of the value type.

◆ LastIndexOf() [1/3]

static int System.Array.LastIndexOf ( Array  array,
object  value 
)
static

Searches for the specified object and returns the index of the last occurrence within the entire one-dimensional T:System.Array.

Parameters
arrayThe one-dimensional T:System.Array to search.
valueThe object to locate in array .
Returns
The index of the last occurrence of value within the entire array , if found; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.

Definition at line 2950 of file Array.cs.

◆ LastIndexOf() [2/3]

static int System.Array.LastIndexOf ( Array  array,
object  value,
int  startIndex 
)
static

Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional T:System.Array that extends from the first element to the specified index.

Parameters
arrayThe one-dimensional T:System.Array to search.
valueThe object to locate in array .
startIndexThe starting index of the backward search.
Returns
The index of the last occurrence of value within the range of elements in array that extends from the first element to startIndex , if found; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .
T:System.RankExceptionarray is multidimensional.

Definition at line 2973 of file Array.cs.

◆ LastIndexOf() [3/3]

static int System.Array.LastIndexOf ( Array  array,
object  value,
int  startIndex,
int  count 
)
static

Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional T:System.Array that contains the specified number of elements and ends at the specified index.

Parameters
arrayThe one-dimensional T:System.Array to search.
valueThe object to locate in array .
startIndexThe starting index of the backward search.
countThe number of elements in the section to search.
Returns
The index of the last occurrence of value within the range of elements in array that contains the number of elements specified in count and ends at startIndex , if found; otherwise, the lower bound of the array minus 1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .
T:System.RankExceptionarray is multidimensional.

Definition at line 3000 of file Array.cs.

◆ LastIndexOf< T >() [1/3]

static int System.Array.LastIndexOf< T > ( T []  array,
T  value 
)
static

Searches for the specified object and returns the index of the last occurrence within the entire T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
valueThe object to locate in array .
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of value within the entire array , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.

Definition at line 3086 of file Array.cs.

◆ LastIndexOf< T >() [2/3]

static int System.Array.LastIndexOf< T > ( T []  array,
T  value,
int  startIndex 
)
static

Searches for the specified object and returns the index of the last occurrence within the range of elements in the T:System.Array that extends from the first element to the specified index.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
valueThe object to locate in array .
startIndexThe zero-based starting index of the backward search.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of value within the range of elements in array that extends from the first element to startIndex , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .

Definition at line 3106 of file Array.cs.

◆ LastIndexOf< T >() [3/3]

static int System.Array.LastIndexOf< T > ( T []  array,
T  value,
int  startIndex,
int  count 
)
static

Searches for the specified object and returns the index of the last occurrence within the range of elements in the T:System.Array that contains the specified number of elements and ends at the specified index.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to search.
valueThe object to locate in array .
startIndexThe zero-based starting index of the backward search.
countThe number of elements in the section to search.
Template Parameters
TThe type of the elements of the array.
Returns
The zero-based index of the last occurrence of value within the range of elements in array that contains the number of elements specified in count and ends at startIndex , if found; otherwise, –1.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionstartIndex is outside the range of valid indexes for array .-or- count is less than zero.-or- startIndex and count do not specify a valid section in array .

Definition at line 3129 of file Array.cs.

◆ Resize< T >()

static void System.Array.Resize< T > ( ref T []  array,
int  newSize 
)
static

Changes the number of elements of a one-dimensional array to the specified new size.

Parameters
arrayThe one-dimensional, zero-based array to resize, or null to create a new array with the specified size.
newSizeThe size of the new array.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentOutOfRangeExceptionnewSize is less than zero.

Definition at line 937 of file Array.cs.

◆ Reverse() [1/2]

static void System.Array.Reverse ( Array  array)
static

Reverses the sequence of the elements in the entire one-dimensional T:System.Array.

Parameters
arrayThe one-dimensional T:System.Array to reverse.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.

Definition at line 3171 of file Array.cs.

◆ Reverse() [2/2]

static void System.Array.Reverse ( Array  array,
int  index,
int  length 
)
static

Reverses the sequence of the elements in a range of elements in the one-dimensional T:System.Array.

Parameters
arrayThe one-dimensional T:System.Array to reverse.
indexThe starting index of the section to reverse.
lengthThe number of elements in the section to reverse.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .

Definition at line 3196 of file Array.cs.

◆ SetValue() [1/8]

unsafe void System.Array.SetValue ( object  value,
int  index 
)

Sets a value to the element at the specified position in the one-dimensional T:System.Array. The index is specified as a 32-bit integer.

Parameters
valueThe new value for the specified element.
indexA 32-bit integer that represents the position of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly one dimension.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.IndexOutOfRangeExceptionindex is outside the range of valid indexes for the current T:System.Array.

Definition at line 1625 of file Array.cs.

◆ SetValue() [2/8]

unsafe void System.Array.SetValue ( object  value,
int  index1,
int  index2 
)

Sets a value to the element at the specified position in the two-dimensional T:System.Array. The indexes are specified as 32-bit integers.

Parameters
valueThe new value for the specified element.
index1A 32-bit integer that represents the first-dimension index of the T:System.Array element to set.
index2A 32-bit integer that represents the second-dimension index of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly two dimensions.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.IndexOutOfRangeExceptionEither index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1645 of file Array.cs.

◆ SetValue() [3/8]

unsafe void System.Array.SetValue ( object  value,
int  index1,
int  index2,
int  index3 
)

Sets a value to the element at the specified position in the three-dimensional T:System.Array. The indexes are specified as 32-bit integers.

Parameters
valueThe new value for the specified element.
index1A 32-bit integer that represents the first-dimension index of the T:System.Array element to set.
index2A 32-bit integer that represents the second-dimension index of the T:System.Array element to set.
index3A 32-bit integer that represents the third-dimension index of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly three dimensions.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.IndexOutOfRangeExceptionindex1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1670 of file Array.cs.

◆ SetValue() [4/8]

unsafe void System.Array.SetValue ( object  value,
params int []  indices 
)

Sets a value to the element at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 32-bit integers.

Parameters
valueThe new value for the specified element.
indicesA one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to set.
Exceptions
T:System.ArgumentNullExceptionindices is null.
T:System.ArgumentExceptionThe number of dimensions in the current T:System.Array is not equal to the number of elements in indices .
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.IndexOutOfRangeExceptionAny element in indices is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1696 of file Array.cs.

◆ SetValue() [5/8]

void System.Array.SetValue ( object  value,
long  index 
)

Sets a value to the element at the specified position in the one-dimensional T:System.Array. The index is specified as a 64-bit integer.

Parameters
valueThe new value for the specified element.
indexA 64-bit integer that represents the position of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly one dimension.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.ArgumentOutOfRangeExceptionindex is outside the range of valid indexes for the current T:System.Array.

Definition at line 1723 of file Array.cs.

◆ SetValue() [6/8]

void System.Array.SetValue ( object  value,
long  index1,
long  index2 
)

Sets a value to the element at the specified position in the two-dimensional T:System.Array. The indexes are specified as 64-bit integers.

Parameters
valueThe new value for the specified element.
index1A 64-bit integer that represents the first-dimension index of the T:System.Array element to set.
index2A 64-bit integer that represents the second-dimension index of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly two dimensions.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.ArgumentOutOfRangeExceptionEither index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1741 of file Array.cs.

◆ SetValue() [7/8]

void System.Array.SetValue ( object  value,
long  index1,
long  index2,
long  index3 
)

Sets a value to the element at the specified position in the three-dimensional T:System.Array. The indexes are specified as 64-bit integers.

Parameters
valueThe new value for the specified element.
index1A 64-bit integer that represents the first-dimension index of the T:System.Array element to set.
index2A 64-bit integer that represents the second-dimension index of the T:System.Array element to set.
index3A 64-bit integer that represents the third-dimension index of the T:System.Array element to set.
Exceptions
T:System.ArgumentExceptionThe current T:System.Array does not have exactly three dimensions.
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.ArgumentOutOfRangeExceptionindex1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1765 of file Array.cs.

◆ SetValue() [8/8]

void System.Array.SetValue ( object  value,
params long []  indices 
)

Sets a value to the element at the specified position in the multidimensional T:System.Array. The indexes are specified as an array of 64-bit integers.

Parameters
valueThe new value for the specified element.
indicesA one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to set.
Exceptions
T:System.ArgumentNullExceptionindices is null.
T:System.ArgumentExceptionThe number of dimensions in the current T:System.Array is not equal to the number of elements in indices .
T:System.InvalidCastExceptionvalue cannot be cast to the element type of the current T:System.Array.
T:System.ArgumentOutOfRangeExceptionAny element in indices is outside the range of valid indexes for the corresponding dimension of the current T:System.Array.

Definition at line 1792 of file Array.cs.

◆ Sort() [1/8]

static void System.Array.Sort ( Array  array)
static

Sorts the elements in an entire one-dimensional T:System.Array using the T:System.IComparable implementation of each element of the T:System.Array.

Parameters
arrayThe one-dimensional T:System.Array to sort.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.InvalidOperationExceptionOne or more elements in array do not implement the T:System.IComparable interface.

Definition at line 3259 of file Array.cs.

◆ Sort() [2/8]

static void System.Array.Sort ( Array  keys,
Array  items 
)
static

Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable implementation of each key.

Parameters
keysThe one-dimensional T:System.Array that contains the keys to sort.
itemsThe one-dimensional T:System.Array that contains the items that correspond to each of the keys in the keys T:System.Array.-or- null to sort only the keys T:System.Array.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.RankExceptionThe keys T:System.Array is multidimensional.-or-The items T:System.Array is multidimensional.
T:System.ArgumentExceptionitems is not null, and the length of keys is greater than the length of items .
T:System.InvalidOperationExceptionOne or more elements in the keys T:System.Array do not implement the T:System.IComparable interface.

Definition at line 3280 of file Array.cs.

◆ Sort() [3/8]

static void System.Array.Sort ( Array  array,
int  index,
int  length 
)
static

Sorts the elements in a range of elements in a one-dimensional T:System.Array using the T:System.IComparable implementation of each element of the T:System.Array.

Parameters
arrayThe one-dimensional T:System.Array to sort.
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .
T:System.InvalidOperationExceptionOne or more elements in array do not implement the T:System.IComparable interface.

Definition at line 3305 of file Array.cs.

◆ Sort() [4/8]

static void System.Array.Sort ( Array  keys,
Array  items,
int  index,
int  length 
)
static

Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable implementation of each key.

Parameters
keysThe one-dimensional T:System.Array that contains the keys to sort.
itemsThe one-dimensional T:System.Array that contains the items that correspond to each of the keys in the keys T:System.Array.-or- null to sort only the keys T:System.Array.
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.RankExceptionThe keys T:System.Array is multidimensional.-or-The items T:System.Array is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of keys .-or- length is less than zero.
T:System.ArgumentExceptionitems is not null, and the length of keys is greater than the length of items .-or- index and length do not specify a valid range in the keys T:System.Array.-or- items is not null, and index and length do not specify a valid range in the items T:System.Array.
T:System.InvalidOperationExceptionOne or more elements in the keys T:System.Array do not implement the T:System.IComparable interface.

Definition at line 3329 of file Array.cs.

◆ Sort() [5/8]

static void System.Array.Sort ( Array  array,
IComparer  comparer 
)
static

Sorts the elements in a one-dimensional T:System.Array using the specified T:System.Collections.IComparer.

Parameters
arrayThe one-dimensional array to sort.
comparerThe implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in array do not implement the T:System.IComparable interface.
T:System.ArgumentExceptionThe implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.

Definition at line 3347 of file Array.cs.

◆ Sort() [6/8]

static void System.Array.Sort ( Array  keys,
Array  items,
IComparer  comparer 
)
static

Sorts a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.IComparer.

Parameters
keysThe one-dimensional T:System.Array that contains the keys to sort.
itemsThe one-dimensional T:System.Array that contains the items that correspond to each of the keys in the keys T:System.Array.-or- null to sort only the keys T:System.Array.
comparerThe T:System.Collections.IComparer implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.RankExceptionThe keys T:System.Array is multidimensional.-or-The items T:System.Array is multidimensional.
T:System.ArgumentExceptionitems is not null, and the length of keys is greater than the length of items . -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in the keys T:System.Array do not implement the T:System.IComparable interface.

Definition at line 3372 of file Array.cs.

◆ Sort() [7/8]

static void System.Array.Sort ( Array  array,
int  index,
int  length,
IComparer  comparer 
)
static

Sorts the elements in a range of elements in a one-dimensional T:System.Array using the specified T:System.Collections.IComparer.

Parameters
arrayThe one-dimensional T:System.Array to sort.
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
comparerThe T:System.Collections.IComparer implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.RankExceptionarray is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array . -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in array do not implement the T:System.IComparable interface.

Definition at line 3401 of file Array.cs.

◆ Sort() [8/8]

static void System.Array.Sort ( Array  keys,
Array  items,
int  index,
int  length,
IComparer  comparer 
)
static

Sorts a range of elements in a pair of one-dimensional T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.IComparer.

Parameters
keysThe one-dimensional T:System.Array that contains the keys to sort.
itemsThe one-dimensional T:System.Array that contains the items that correspond to each of the keys in the keys T:System.Array.-or- null to sort only the keys T:System.Array.
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
comparerThe T:System.Collections.IComparer implementation to use when comparing elements.-or- null to use the T:System.IComparable implementation of each element.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.RankExceptionThe keys T:System.Array is multidimensional.-or-The items T:System.Array is multidimensional.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of keys .-or- length is less than zero.
T:System.ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items .-or- items is not null, and the length of keys is greater than the length of items .-or- index and length do not specify a valid range in the keys T:System.Array.-or- items is not null, and index and length do not specify a valid range in the items T:System.Array. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in the keys T:System.Array do not implement the T:System.IComparable interface.

Definition at line 3431 of file Array.cs.

◆ Sort< T >() [1/5]

static void System.Array.Sort< T > ( T []  array)
static

Sorts the elements in an entire T:System.Array using the T:System.IComparable`1 generic interface implementation of each element of the T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to sort.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.InvalidOperationExceptionOne or more elements in array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3485 of file Array.cs.

◆ Sort< T >() [2/5]

static void System.Array.Sort< T > ( T []  array,
int  index,
int  length 
)
static

Sorts the elements in a range of elements in an T:System.Array using the T:System.IComparable`1 generic interface implementation of each element of the T:System.Array.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to sort
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array .
T:System.InvalidOperationExceptionOne or more elements in array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3531 of file Array.cs.

◆ Sort< T >() [3/5]

static void System.Array.Sort< T > ( T []  array,
IComparer< T comparer 
)
static

Sorts the elements in an T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
arrayThe one-dimensional, zero-base T:System.Array to sort
comparerThe T:System.Collections.Generic.IComparer`1 generic interface implementation to use when comparing elements, or null to use the T:System.IComparable`1 generic interface implementation of each element.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in array do not implement the T:System.IComparable`1 generic interface.
T:System.ArgumentExceptionThe implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.

Definition at line 3572 of file Array.cs.

◆ Sort< T >() [4/5]

static void System.Array.Sort< T > ( T []  array,
int  index,
int  length,
IComparer< T comparer 
)
static

Sorts the elements in a range of elements in an T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to sort.
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
comparerThe T:System.Collections.Generic.IComparer`1 generic interface implementation to use when comparing elements, or null to use the T:System.IComparable`1 generic interface implementation of each element.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of array .-or- length is less than zero.
T:System.ArgumentExceptionindex and length do not specify a valid range in array . -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3625 of file Array.cs.

◆ Sort< T >() [5/5]

static void System.Array.Sort< T > ( T []  array,
Comparison< T comparison 
)
static

Sorts the elements in an T:System.Array using the specified T:System.Comparison`1.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to sort
comparisonThe T:System.Comparison`1 to use when comparing elements.
Template Parameters
TThe type of the elements of the array.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- comparison is null.
T:System.ArgumentExceptionThe implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself.

Definition at line 3705 of file Array.cs.

◆ Sort< TKey, TValue >() [1/4]

static void System.Array.Sort< TKey, TValue > ( TKey []  keys,
TValue []  items 
)
static

Sorts a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable`1 generic interface implementation of each key.

Parameters
keysThe one-dimensional, zero-based T:System.Array that contains the keys to sort.
itemsThe one-dimensional, zero-based T:System.Array that contains the items that correspond to the keys in keys , or null to sort only keys .
Template Parameters
TKeyThe type of the elements of the key array.
TValueThe type of the elements of the items array.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items .-or- items is not null, and the length of keys is greater than the length of items .
T:System.InvalidOperationExceptionOne or more elements in the keys T:System.Array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3507 of file Array.cs.

◆ Sort< TKey, TValue >() [2/4]

static void System.Array.Sort< TKey, TValue > ( TKey []  keys,
TValue []  items,
int  index,
int  length 
)
static

Sorts a range of elements in a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the T:System.IComparable`1 generic interface implementation of each key.

Parameters
keysThe one-dimensional, zero-based T:System.Array that contains the keys to sort.
itemsThe one-dimensional, zero-based T:System.Array that contains the items that correspond to the keys in keys , or null to sort only keys .
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
Template Parameters
TKeyThe type of the elements of the key array.
TValueThe type of the elements of the items array.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of keys .-or- length is less than zero.
T:System.ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items .-or- items is not null, and the length of keys is greater than the length of items .-or- index and length do not specify a valid range in the keys T:System.Array.-or- items is not null, and index and length do not specify a valid range in the items T:System.Array.
T:System.InvalidOperationExceptionOne or more elements in the keys T:System.Array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3556 of file Array.cs.

◆ Sort< TKey, TValue >() [3/4]

static void System.Array.Sort< TKey, TValue > ( TKey []  keys,
TValue []  items,
IComparer< TKey >  comparer 
)
static

Sorts a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
keysThe one-dimensional, zero-based T:System.Array that contains the keys to sort.
itemsThe one-dimensional, zero-based T:System.Array that contains the items that correspond to the keys in keys , or null to sort only keys .
comparerThe T:System.Collections.Generic.IComparer`1 generic interface implementation to use when comparing elements, or null to use the T:System.IComparable`1 generic interface implementation of each element.
Template Parameters
TKeyThe type of the elements of the key array.
TValueThe type of the elements of the items array.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items .-or- items is not null, and the length of keys is greater than the length of items .-or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in the keys T:System.Array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3597 of file Array.cs.

◆ Sort< TKey, TValue >() [4/4]

static void System.Array.Sort< TKey, TValue > ( TKey []  keys,
TValue []  items,
int  index,
int  length,
IComparer< TKey >  comparer 
)
static

Sorts a range of elements in a pair of T:System.Array objects (one contains the keys and the other contains the corresponding items) based on the keys in the first T:System.Array using the specified T:System.Collections.Generic.IComparer`1 generic interface.

Parameters
keysThe one-dimensional, zero-based T:System.Array that contains the keys to sort.
itemsThe one-dimensional, zero-based T:System.Array that contains the items that correspond to the keys in keys , or null to sort only keys .
indexThe starting index of the range to sort.
lengthThe number of elements in the range to sort.
comparerThe T:System.Collections.Generic.IComparer`1 generic interface implementation to use when comparing elements, or null to use the T:System.IComparable`1 generic interface implementation of each element.
Template Parameters
TKeyThe type of the elements of the key array.
TValueThe type of the elements of the items array.
Exceptions
T:System.ArgumentNullExceptionkeys is null.
T:System.ArgumentOutOfRangeExceptionindex is less than the lower bound of keys .-or- length is less than zero.
T:System.ArgumentExceptionitems is not null, and the lower bound of keys does not match the lower bound of items .-or- items is not null, and the length of keys is greater than the length of items .-or- index and length do not specify a valid range in the keys T:System.Array.-or- items is not null, and index and length do not specify a valid range in the items T:System.Array. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself.
T:System.InvalidOperationExceptioncomparer is null, and one or more elements in the keys T:System.Array do not implement the T:System.IComparable`1 generic interface.

Definition at line 3669 of file Array.cs.

◆ TrueForAll< T >()

static bool System.Array.TrueForAll< T > ( T []  array,
Predicate< T match 
)
static

Determines whether every element in the array matches the conditions defined by the specified predicate.

Parameters
arrayThe one-dimensional, zero-based T:System.Array to check against the conditions.
matchThe predicate that defines the conditions to check against the elements.
Template Parameters
TThe type of the elements of the array.
Returns
true if every element in array matches the conditions defined by the specified predicate; otherwise, false. If there are no elements in the array, the return value is true.
Exceptions
T:System.ArgumentNullExceptionarray is null.-or- match is null.

Definition at line 3729 of file Array.cs.

Member Data Documentation

◆ IsFixedSize

bool System.Array.IsFixedSize => true

Gets a value indicating whether the T:System.Array has a fixed size.

Returns
This property is always true for all arrays.

Definition at line 882 of file Array.cs.

◆ IsReadOnly

bool System.Array.IsReadOnly => false

Gets a value indicating whether the T:System.Array is read-only.

Returns
This property is always false for all arrays.

Definition at line 878 of file Array.cs.

◆ IsSynchronized

bool System.Array.IsSynchronized => false

Gets a value indicating whether access to the T:System.Array is synchronized (thread safe).

Returns
This property is always false for all arrays.

Definition at line 886 of file Array.cs.

◆ SyncRoot

object System.Array.SyncRoot => this

Gets an object that can be used to synchronize access to the T:System.Array.

Returns
An object that can be used to synchronize access to the T:System.Array.

Definition at line 874 of file Array.cs.

Property Documentation

◆ Length

int System.Array.Length
get

Gets the total number of elements in all the dimensions of the T:System.Array.

Returns
The total number of elements in all the dimensions of the T:System.Array; zero if there are no elements in the array.
Exceptions
T:System.OverflowExceptionThe array is multidimensional and contains more than F:System.Int32.MaxValue elements.

Definition at line 829 of file Array.cs.

◆ LongLength

long System.Array.LongLength
get

Gets a 64-bit integer that represents the total number of elements in all the dimensions of the T:System.Array.

Returns
A 64-bit integer that represents the total number of elements in all the dimensions of the T:System.Array.

Definition at line 841 of file Array.cs.

◆ Rank

int System.Array.Rank
get

Gets the rank (number of dimensions) of the T:System.Array. For example, a one-dimensional array returns 1, a two-dimensional array returns 2, and so on.

Returns
The rank (number of dimensions) of the T:System.Array.

Definition at line 852 of file Array.cs.


The documentation for this class was generated from the following file: