Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

class System.​Array

Assembly: System.Runtime

Inheritance: object → Array

Implemented Interfaces

Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.

Properties

public bool
IsFixedSize
Gets a value indicating whether the <see cref="T:System.Array" /> has a fixed size.
public bool
IsReadOnly
Gets a value indicating whether the <see cref="T:System.Array" /> is read-only.
public bool
IsSynchronized
Gets a value indicating whether access to the <see cref="T:System.Array" /> is synchronized (thread safe).
public int
Length
Gets the total number of elements in all the dimensions of the <see cref="T:System.Array" /> .
public long
LongLength
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the <see cref="T:System.Array" /> .
public static int
MaxLength
Gets the maximum number of elements that may be contained in an array.
public int
Rank
Gets the rank (number of dimensions) of the <see cref="T:System.Array" /> . For example, a one-dimensional array returns 1, a two-dimensional array returns 2, and so on.
public object
SyncRoot
Gets an object that can be used to synchronize access to the <see cref="T:System.Array" /> .

Methods

public static ReadOnlyCollection<​T>
AsReadOnly​(T[] array)
Returns a read-only wrapper for the specified array.
Returns A read-only <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> wrapper for the specified array.
array The one-dimensional, zero-based array to wrap in a read-only <see cref="T:System.Collections.ObjectModel.ReadOnlyCollection`1" /> wrapper.
public 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 <see cref="T:System.IComparable" /> interface implemented by each element of the array and by the specified value.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional <see cref="T:System.Array" /> to search.
index The starting index of the range to search.
length The length of the range to search.
value The object to search for.
public 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 <see cref="T:System.Collections.IComparer" /> interface.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional <see cref="T:System.Array" /> to search.
index The starting index of the range to search.
length The length of the range to search.
value The object to search for.
comparer The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static int
BinarySearch​(Array array, object value)
Searches an entire one-dimensional sorted array for a specific element, using the <see cref="T:System.IComparable" /> interface implemented by each element of the array and by the specified object.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional <see cref="T:System.Array" /> to search.
value The object to search for.
public static int
BinarySearch​(Array array, object value, IComparer comparer)
Searches an entire one-dimensional sorted array for a value using the specified <see cref="T:System.Collections.IComparer" /> interface.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional <see cref="T:System.Array" /> to search.
value The object to search for.
comparer The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static int
BinarySearch​(T[] array, int index, int length, T value)
Searches a range of elements in a one-dimensional sorted array for a value, using the <see cref="T:System.IComparable`1" /> generic interface implemented by each element of the <see cref="T:System.Array" /> and by the specified value.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional, zero-based <see cref="T:System.Array" /> to search.
index The starting index of the range to search.
length The length of the range to search.
value The object to search for.
public static int
BinarySearch​(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 <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional, zero-based <see cref="T:System.Array" /> to search.
index The starting index of the range to search.
length The length of the range to search.
value The object to search for.
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> implementation of each element.
public static int
BinarySearch​(T[] array, T value)
Searches an entire one-dimensional sorted array for a specific element, using the <see cref="T:System.IComparable`1" /> generic interface implemented by each element of the <see cref="T:System.Array" /> and by the specified object.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional, zero-based <see cref="T:System.Array" /> to search.
value The object to search for.
public static int
BinarySearch​(T[] array, T value, IComparer?<​T> comparer)
Searches an entire one-dimensional sorted array for a value using the specified <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
Returns The index of the specified <paramref name="value" /> in the specified <paramref name="array" /> , if <paramref name="value" /> is found; otherwise, a negative number. If <paramref name="value" /> is not found and <paramref name="value" /> is less than one or more elements in <paramref name="array" /> , the negative number returned is the bitwise complement of the index of the first element that is larger than <paramref name="value" /> . If <paramref name="value" /> is not found and <paramref name="value" /> is greater than all elements in <paramref name="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 <paramref name="array" /> , the return value can be incorrect and a negative number could be returned, even if <paramref name="value" /> is present in <paramref name="array" /> .
array The sorted one-dimensional, zero-based <see cref="T:System.Array" /> to search.
value The object to search for.
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> implementation of each element.
public static void
Clear​(Array array)
Clears the contents of an array.
array The array to clear.
public 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.
array The array whose elements need to be cleared.
index The starting index of the range of elements to clear.
length The number of elements to clear.
public object
Clone​()
Creates a shallow copy of the <see cref="T:System.Array" /> .
Returns A shallow copy of the <see cref="T:System.Array" /> .
public static void
ConstrainedCopy​(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely.
sourceArray The <see cref="T:System.Array" /> that contains the data to copy.
sourceIndex A 32-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.
destinationArray The <see cref="T:System.Array" /> that receives the data.
destinationIndex A 32-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.
length A 32-bit integer that represents the number of elements to copy.
public static TOutput[]
ConvertAll​(TInput[] array, Converter<​TInput, TOutput> converter)
Converts an array of one type to an array of another type.
Returns An array of the target type containing the converted elements from the source array.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to convert to a target type.
converter A <see cref="T:System.Converter`2" /> that converts each element from one type to another type.
public static void
Copy​(Array sourceArray, Array destinationArray, int length)
Copies a range of elements from an <see cref="T:System.Array" /> starting at the first element and pastes them into another <see cref="T:System.Array" /> starting at the first element. The length is specified as a 32-bit integer.
sourceArray The <see cref="T:System.Array" /> that contains the data to copy.
destinationArray The <see cref="T:System.Array" /> that receives the data.
length A 32-bit integer that represents the number of elements to copy.
public static void
Copy​(Array sourceArray, Array destinationArray, long length)
Copies a range of elements from an <see cref="T:System.Array" /> starting at the first element and pastes them into another <see cref="T:System.Array" /> starting at the first element. The length is specified as a 64-bit integer.
sourceArray The <see cref="T:System.Array" /> that contains the data to copy.
destinationArray The <see cref="T:System.Array" /> that receives the data.
length A 64-bit integer that represents the number of elements to copy. The integer must be between zero and <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see> , inclusive.
public static void
Copy​(Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length)
Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. The length and the indexes are specified as 32-bit integers.
sourceArray The <see cref="T:System.Array" /> that contains the data to copy.
sourceIndex A 32-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.
destinationArray The <see cref="T:System.Array" /> that receives the data.
destinationIndex A 32-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.
length A 32-bit integer that represents the number of elements to copy.
public static void
Copy​(Array sourceArray, long sourceIndex, Array destinationArray, long destinationIndex, long length)
Copies a range of elements from an <see cref="T:System.Array" /> starting at the specified source index and pastes them to another <see cref="T:System.Array" /> starting at the specified destination index. The length and the indexes are specified as 64-bit integers.
sourceArray The <see cref="T:System.Array" /> that contains the data to copy.
sourceIndex A 64-bit integer that represents the index in <paramref name="sourceArray" /> at which copying begins.
destinationArray The <see cref="T:System.Array" /> that receives the data.
destinationIndex A 64-bit integer that represents the index in <paramref name="destinationArray" /> at which storing begins.
length A 64-bit integer that represents the number of elements to copy. The integer must be between zero and <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see> , inclusive.
public 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.
array The one-dimensional array that is the destination of the elements copied from the current array.
index A 32-bit integer that represents the index in the destination array at which copying begins.
public 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.
array The one-dimensional array that is the destination of the elements copied from the current array.
index A 64-bit integer that represents the index in the destination array at which copying begins.
public static Array
CreateInstance​(Type elementType, int length)
Creates a one-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and length, with zero-based indexing.
Returns A new one-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length, using zero-based indexing.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
length The size of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstance​(Type elementType, int length1, int length2)
Creates a two-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with zero-based indexing.
Returns A new two-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length for each dimension, using zero-based indexing.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
length1 The size of the first dimension of the <see cref="T:System.Array" /> to create.
length2 The size of the second dimension of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstance​(Type elementType, int length1, int length2, int length3)
Creates a three-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with zero-based indexing.
Returns A new three-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length for each dimension, using zero-based indexing.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
length1 The size of the first dimension of the <see cref="T:System.Array" /> to create.
length2 The size of the second dimension of the <see cref="T:System.Array" /> to create.
length3 The size of the third dimension of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstance​(Type elementType, int[] lengths)
Creates a multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers.
Returns A new multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length for each dimension, using zero-based indexing.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
lengths An array of 32-bit integers that represent the size of each dimension of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstance​(Type elementType, int[] lengths, int[] lowerBounds)
Creates a multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with the specified lower bounds.
Returns A new multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length and lower bound for each dimension.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
lengths A one-dimensional array that contains the size of each dimension of the <see cref="T:System.Array" /> to create.
lowerBounds A one-dimensional array that contains the lower bound (starting index) of each dimension of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstance​(Type elementType, long[] lengths)
Creates a multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.
Returns A new multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length for each dimension, using zero-based indexing.
elementType The <see cref="T:System.Type" /> of the <see cref="T:System.Array" /> to create.
lengths An array of 64-bit integers that represent the size of each dimension of the <see cref="T:System.Array" /> to create. Each integer in the array must be between zero and <see cref="F:System.Int32.MaxValue">Int32.MaxValue</see> , inclusive.
public static Array
CreateInstanceFromArrayType​(Type arrayType, int length)
Creates a one-dimensional <see cref="T:System.Array" /> of the specified array type and length, with zero-based indexing.
Returns A new one-dimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length.
arrayType The type of the array (not of the array element type).
length The size of the <see cref="T:System.Array" /> to create.
public static Array
CreateInstanceFromArrayType​(Type arrayType, int[] lengths)
Creates a multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with zero-based indexing.
Returns A new multidimensional <see cref="T:System.Array" /> of the specified Type with the specified length for each dimension, using zero-based indexing.
arrayType The type of the array (not of the array element type).
lengths The dimension lengths, specified in an array of 32-bit integers.
public static Array
CreateInstanceFromArrayType​(Type arrayType, int[] lengths, int[] lowerBounds)
Creates a multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> and dimension lengths, with the specified lower bounds.
Returns A new multidimensional <see cref="T:System.Array" /> of the specified <see cref="T:System.Type" /> with the specified length and lower bound for each dimension.
arrayType The type of the array (not of the array element type).
lengths The dimension lengths, specified in an array of 32-bit integers.
lowerBounds A one-dimensional array that contains the lower bound (starting index) of each dimension of the <see cref="T:System.Array" /> to create.
public static T[]
Empty​()
Returns an empty array.
Returns An empty array.
public static bool
Exists​(T[] array, Predicate<​T> match)
Determines whether the specified array contains elements that match the conditions defined by the specified predicate.
Returns <see langword="true" /> if <paramref name="array" /> contains one or more elements that match the conditions defined by the specified predicate; otherwise, <see langword="false" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the elements to search for.
public static void
Fill​(T[] array, T value)
Assigns the given <paramref name="value" /> of type <typeparamref name="T" /> to each element of the specified <paramref name="array" /> .
array The array to be filled.
value The value to assign to each array element.
public static void
Fill​(T[] array, T value, int startIndex, int count)
Assigns the given <paramref name="value" /> of type <typeparamref name="T" /> to the elements of the specified <paramref name="array" /> that are within the range of <paramref name="startIndex" /> (inclusive) and the next <paramref name="count" /> number of indices.
array The array to be filled.
value The new value for the elements in the specified range.
startIndex A 32-bit integer that represents the index in <paramref name="array" /> at which filling begins.
count The number of elements to copy.
public static T[]
FindAll​(T[] array, Predicate<​T> match)
Retrieves all the elements that match the conditions defined by the specified predicate.
Returns An <see cref="T:System.Array" /> containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty <see cref="T:System.Array" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the elements to search for.
public static int
FindIndex​(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 <see cref="T:System.Array" /> that starts at the specified index and contains the specified number of elements.
Returns The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
startIndex The zero-based starting index of the search.
count The number of elements in the section to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static int
FindIndex​(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 <see cref="T:System.Array" /> that extends from the specified index to the last element.
Returns The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
startIndex The zero-based starting index of the search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static int
FindIndex​(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 <see cref="T:System.Array" /> .
Returns The zero-based index of the first occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static int
FindLastIndex​(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 <see cref="T:System.Array" /> that contains the specified number of elements and ends at the specified index.
Returns The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
startIndex The zero-based starting index of the backward search.
count The number of elements in the section to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static int
FindLastIndex​(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 <see cref="T:System.Array" /> that extends from the first element to the specified index.
Returns The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
startIndex The zero-based starting index of the backward search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static int
FindLastIndex​(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 <see cref="T:System.Array" /> .
Returns The zero-based index of the last occurrence of an element that matches the conditions defined by <paramref name="match" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static T
FindLast​(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 <see cref="T:System.Array" /> .
Returns The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type <typeparamref name="T" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
match The <see cref="T:System.Predicate`1" /> that defines the conditions of the element to search for.
public static T
Find​(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 <see cref="T:System.Array" /> .
Returns The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type <typeparamref name="T" /> .
array The one-dimensional, zero-based array to search.
match The predicate that defines the conditions of the element to search for.
public static void
ForEach​(T[] array, Action<​T> action)
Performs the specified action on each element of the specified array.
array The one-dimensional, zero-based <see cref="T:System.Array" /> on whose elements the action is to be performed.
action The <see cref="T:System.Action`1" /> to perform on each element of <paramref name="array" /> .
public IEnumerator
GetEnumerator​()
Returns an <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Array" /> .
Returns An <see cref="T:System.Collections.IEnumerator" /> for the <see cref="T:System.Array" /> .
public int
GetLength​(int dimension)
Gets a 32-bit integer that represents the number of elements in the specified dimension of the <see cref="T:System.Array" /> .
Returns A 32-bit integer that represents the number of elements in the specified dimension.
dimension A zero-based dimension of the <see cref="T:System.Array" /> whose length needs to be determined.
public long
GetLongLength​(int dimension)
Gets a 64-bit integer that represents the number of elements in the specified dimension of the <see cref="T:System.Array" /> .
Returns A 64-bit integer that represents the number of elements in the specified dimension.
dimension A zero-based dimension of the <see cref="T:System.Array" /> whose length needs to be determined.
public int
GetLowerBound​(int dimension)
Gets the index of the first element of the specified dimension in the array.
Returns The index of the first element of the specified dimension in the array.
dimension A zero-based dimension of the array whose starting index needs to be determined.
public int
GetUpperBound​(int dimension)
Gets the index of the last element of the specified dimension in the array.
Returns The index of the last element of the specified dimension in the array, or -1 if the specified dimension is empty.
dimension A zero-based dimension of the array whose upper bound needs to be determined.
public object
GetValue​(int index)
Gets the value at the specified position in the one-dimensional <see cref="T:System.Array" /> . The index is specified as a 32-bit integer.
Returns The value at the specified position in the one-dimensional <see cref="T:System.Array" /> .
index A 32-bit integer that represents the position of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(int index1, int index2)
Gets the value at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
Returns The value at the specified position in the two-dimensional <see cref="T:System.Array" /> .
index1 A 32-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to get.
index2 A 32-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(int index1, int index2, int index3)
Gets the value at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
Returns The value at the specified position in the three-dimensional <see cref="T:System.Array" /> .
index1 A 32-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to get.
index2 A 32-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to get.
index3 A 32-bit integer that represents the third-dimension index of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(int[] indices)
Gets the value at the specified position in the multidimensional <see cref="T:System.Array" /> . The indexes are specified as an array of 32-bit integers.
Returns The value at the specified position in the multidimensional <see cref="T:System.Array" /> .
indices A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(long index)
Gets the value at the specified position in the one-dimensional <see cref="T:System.Array" /> . The index is specified as a 64-bit integer.
Returns The value at the specified position in the one-dimensional <see cref="T:System.Array" /> .
index A 64-bit integer that represents the position of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(long index1, long index2)
Gets the value at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
Returns The value at the specified position in the two-dimensional <see cref="T:System.Array" /> .
index1 A 64-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to get.
index2 A 64-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(long index1, long index2, long index3)
Gets the value at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
Returns The value at the specified position in the three-dimensional <see cref="T:System.Array" /> .
index1 A 64-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to get.
index2 A 64-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to get.
index3 A 64-bit integer that represents the third-dimension index of the <see cref="T:System.Array" /> element to get.
public object
GetValue​(long[] indices)
Gets the value at the specified position in the multidimensional <see cref="T:System.Array" /> . The indexes are specified as an array of 64-bit integers.
Returns The value at the specified position in the multidimensional <see cref="T:System.Array" /> .
indices A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the <see cref="T:System.Array" /> element to get.
public 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.
Returns The index of the first occurrence of <paramref name="value" /> in <paramref name="array" /> , if found; otherwise, the lower bound of the array minus 1.
array The one-dimensional array to search.
value The object to locate in <paramref name="array" /> .
public 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.
Returns The index of the first occurrence of <paramref name="value" /> , if it's found, within the range of elements in <paramref name="array" /> that extends from <paramref name="startIndex" /> to the last element; otherwise, the lower bound of the array minus 1.
array The one-dimensional array to search.
value The object to locate in <paramref name="array" /> .
startIndex The starting index of the search. 0 (zero) is valid in an empty array.
public 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.
Returns The index of the first occurrence of <paramref name="value" /> , if it's found in the <paramref name="array" /> from index <paramref name="startIndex" /> to <paramref name="startIndex" /> + <paramref name="count" /> - 1; otherwise, the lower bound of the array minus 1.
array The one-dimensional array to search.
value The object to locate in <paramref name="array" /> .
startIndex The starting index of the search. 0 (zero) is valid in an empty array.
count The number of elements to search.
public static int
IndexOf​(T[] array, T value)
Searches for the specified object and returns the index of its first occurrence in a one-dimensional array.
Returns The zero-based index of the first occurrence of <paramref name="value" /> in the entire <paramref name="array" /> , if found; otherwise, -1.
array The one-dimensional, zero-based array to search.
value The object to locate in <paramref name="array" /> .
public static int
IndexOf​(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.
Returns The zero-based index of the first occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that extends from <paramref name="startIndex" /> to the last element, if found; otherwise, -1.
array The one-dimensional, zero-based array to search.
value The object to locate in <paramref name="array" /> .
startIndex The zero-based starting index of the search. 0 (zero) is valid in an empty array.
public static int
IndexOf​(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.
Returns The zero-based index of the first occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that starts at <paramref name="startIndex" /> and contains the number of elements specified in <paramref name="count" /> , if found; otherwise, -1.
array The one-dimensional, zero-based array to search.
value The object to locate in <paramref name="array" /> .
startIndex The zero-based starting index of the search. 0 (zero) is valid in an empty array.
count The number of elements in the section to search.
public void
Initialize​()
Initializes every element of the value-type <see cref="T:System.Array" /> by calling the parameterless constructor of the value type.
public 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 <see cref="T:System.Array" /> .
Returns The index of the last occurrence of <paramref name="value" /> within the entire <paramref name="array" /> , if found; otherwise, the lower bound of the array minus 1.
array The one-dimensional <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
public 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 <see cref="T:System.Array" /> that extends from the first element to the specified index.
Returns The index of the last occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that extends from the first element to <paramref name="startIndex" /> , if found; otherwise, the lower bound of the array minus 1.
array The one-dimensional <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
startIndex The starting index of the backward search.
public 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 <see cref="T:System.Array" /> that contains the specified number of elements and ends at the specified index.
Returns The index of the last occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that contains the number of elements specified in <paramref name="count" /> and ends at <paramref name="startIndex" /> , if found; otherwise, the lower bound of the array minus 1.
array The one-dimensional <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
startIndex The starting index of the backward search.
count The number of elements in the section to search.
public static int
LastIndexOf​(T[] array, T value)
Searches for the specified object and returns the index of the last occurrence within the entire <see cref="T:System.Array" /> .
Returns The zero-based index of the last occurrence of <paramref name="value" /> within the entire <paramref name="array" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
public static int
LastIndexOf​(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 <see cref="T:System.Array" /> that extends from the first element to the specified index.
Returns The zero-based index of the last occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that extends from the first element to <paramref name="startIndex" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
startIndex The zero-based starting index of the backward search.
public static int
LastIndexOf​(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 <see cref="T:System.Array" /> that contains the specified number of elements and ends at the specified index.
Returns The zero-based index of the last occurrence of <paramref name="value" /> within the range of elements in <paramref name="array" /> that contains the number of elements specified in <paramref name="count" /> and ends at <paramref name="startIndex" /> , if found; otherwise, -1.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to search.
value The object to locate in <paramref name="array" /> .
startIndex The zero-based starting index of the backward search.
count The number of elements in the section to search.
public static void
Resize​(T[]&? array, int newSize)
public static void
Reverse​(Array array)
Reverses the sequence of the elements in the entire one-dimensional <see cref="T:System.Array" /> .
array The one-dimensional <see cref="T:System.Array" /> to reverse.
public static void
Reverse​(Array array, int index, int length)
Reverses the sequence of a subset of the elements in the one-dimensional <see cref="T:System.Array" /> .
array The one-dimensional <see cref="T:System.Array" /> to reverse.
index The starting index of the section to reverse.
length The number of elements in the section to reverse.
public static void
Reverse​(T[] array)
Reverses the sequence of the elements in the one-dimensional generic array.
array The one-dimensional array of elements to reverse.
public static void
Reverse​(T[] array, int index, int length)
Reverses the sequence of a subset of the elements in the one-dimensional generic array.
array The one-dimensional array of elements to reverse.
index The starting index of the section to reverse.
length The number of elements in the section to reverse.
public void
SetValue​(object value, int index)
Sets a value to the element at the specified position in the one-dimensional <see cref="T:System.Array" /> . The index is specified as a 32-bit integer.
value The new value for the specified element.
index A 32-bit integer that represents the position of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, int index1, int index2)
Sets a value to the element at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
value The new value for the specified element.
index1 A 32-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to set.
index2 A 32-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, int index1, int index2, int index3)
Sets a value to the element at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
value The new value for the specified element.
index1 A 32-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to set.
index2 A 32-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to set.
index3 A 32-bit integer that represents the third-dimension index of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, int[] indices)
Sets a value to the element at the specified position in the multidimensional <see cref="T:System.Array" /> . The indexes are specified as an array of 32-bit integers.
value The new value for the specified element.
indices A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to set.
public void
SetValue​(object value, long index)
Sets a value to the element at the specified position in the one-dimensional <see cref="T:System.Array" /> . The index is specified as a 64-bit integer.
value The new value for the specified element.
index A 64-bit integer that represents the position of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, long index1, long index2)
Sets a value to the element at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
value The new value for the specified element.
index1 A 64-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to set.
index2 A 64-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, long index1, long index2, long index3)
Sets a value to the element at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
value The new value for the specified element.
index1 A 64-bit integer that represents the first-dimension index of the <see cref="T:System.Array" /> element to set.
index2 A 64-bit integer that represents the second-dimension index of the <see cref="T:System.Array" /> element to set.
index3 A 64-bit integer that represents the third-dimension index of the <see cref="T:System.Array" /> element to set.
public void
SetValue​(object value, long[] indices)
Sets a value to the element at the specified position in the multidimensional <see cref="T:System.Array" /> . The indexes are specified as an array of 64-bit integers.
value The new value for the specified element.
indices A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to set.
public static void
Sort​(Array array)
Sorts the elements in an entire one-dimensional <see cref="T:System.Array" /> using the <see cref="T:System.IComparable" /> implementation of each element of the <see cref="T:System.Array" /> .
array The one-dimensional <see cref="T:System.Array" /> to sort.
public static void
Sort​(Array keys, Array? items)
Sorts a pair of one-dimensional <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the <see cref="T:System.IComparable" /> implementation of each key.
keys The one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each of the keys in the <paramref name="keys" /> <see cref="T:System.Array" /> . -or- <see langword="null" /> to sort only the <paramref name="keys" /> <see cref="T:System.Array" /> .
public static void
Sort​(Array keys, Array items, IComparer comparer)
Sorts a pair of one-dimensional <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> .
keys The one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each of the keys in the <paramref name="keys" /> <see cref="T:System.Array" /> . -or- <see langword="null" /> to sort only the <paramref name="keys" /> <see cref="T:System.Array" /> .
comparer The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static void
Sort​(Array keys, Array? items, int index, int length)
Sorts a range of elements in a pair of one-dimensional <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the <see cref="T:System.IComparable" /> implementation of each key.
keys The one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each of the keys in the <paramref name="keys" /> <see cref="T:System.Array" /> . -or- <see langword="null" /> to sort only the <paramref name="keys" /> <see cref="T:System.Array" /> .
index The starting index of the range to sort.
length The number of elements in the range to sort.
public static void
Sort​(Array keys, Array items, int index, int length, IComparer comparer)
Sorts a range of elements in a pair of one-dimensional <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> .
keys The one-dimensional <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional <see cref="T:System.Array" /> that contains the items that correspond to each of the keys in the <paramref name="keys" /> <see cref="T:System.Array" /> . -or- <see langword="null" /> to sort only the <paramref name="keys" /> <see cref="T:System.Array" /> .
index The starting index of the range to sort.
length The number of elements in the range to sort.
comparer The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static void
Sort​(Array array, IComparer? comparer)
Sorts the elements in a one-dimensional <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> .
array The one-dimensional array to sort.
comparer The implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static void
Sort​(Array array, int index, int length)
Sorts the elements in a range of elements in a one-dimensional <see cref="T:System.Array" /> using the <see cref="T:System.IComparable" /> implementation of each element of the <see cref="T:System.Array" /> .
array The one-dimensional <see cref="T:System.Array" /> to sort.
index The starting index of the range to sort.
length The number of elements in the range to sort.
public static void
Sort​(Array array, int index, int length, IComparer? comparer)
Sorts the elements in a range of elements in a one-dimensional <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.IComparer" /> .
array The one-dimensional <see cref="T:System.Array" /> to sort.
index The starting index of the range to sort.
length The number of elements in the range to sort.
comparer The <see cref="T:System.Collections.IComparer" /> implementation to use when comparing elements. -or- <see langword="null" /> to use the <see cref="T:System.IComparable" /> implementation of each element.
public static void
Sort​(T[] array)
Sorts the elements in an entire <see cref="T:System.Array" /> using the <see cref="T:System.IComparable`1" /> generic interface implementation of each element of the <see cref="T:System.Array" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to sort.
public static void
Sort​(T[] array, IComparer?<​T> comparer)
Sorts the elements in an <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
array The one-dimensional, zero-base <see cref="T:System.Array" /> to sort.
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface implementation to use when comparing elements, or <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> generic interface implementation of each element.
public static void
Sort​(T[] array, Comparison<​T> comparison)
Sorts the elements in an <see cref="T:System.Array" /> using the specified <see cref="T:System.Comparison`1" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to sort.
comparison The <see cref="T:System.Comparison`1" /> to use when comparing elements.
public static void
Sort​(T[] array, int index, int length)
Sorts the elements in a range of elements in an <see cref="T:System.Array" /> using the <see cref="T:System.IComparable`1" /> generic interface implementation of each element of the <see cref="T:System.Array" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to sort.
index The starting index of the range to sort.
length The number of elements in the range to sort.
public static void
Sort​(T[] array, int index, int length, IComparer?<​T> comparer)
Sorts the elements in a range of elements in an <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
array The one-dimensional, zero-based <see cref="T:System.Array" /> to sort.
index The starting index of the range to sort.
length The number of elements in the range to sort.
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface implementation to use when comparing elements, or <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> generic interface implementation of each element.
public static void
Sort​(TKey[] keys, TValue[] items)
Sorts a pair of <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the <see cref="T:System.IComparable`1" /> generic interface implementation of each key.
keys The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the items that correspond to the keys in <paramref name="keys" /> , or <see langword="null" /> to sort only <paramref name="keys" /> .
public static void
Sort​(TKey[] keys, TValue[] items, IComparer?<​TKey> comparer)
Sorts a pair of <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
keys The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the items that correspond to the keys in <paramref name="keys" /> , or <see langword="null" /> to sort only <paramref name="keys" /> .
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface implementation to use when comparing elements, or <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> generic interface implementation of each element.
public static void
Sort​(TKey[] keys, TValue[] items, int index, int length)
Sorts a range of elements in a pair of <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the <see cref="T:System.IComparable`1" /> generic interface implementation of each key.
keys The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the items that correspond to the keys in <paramref name="keys" /> , or <see langword="null" /> to sort only <paramref name="keys" /> .
index The starting index of the range to sort.
length The number of elements in the range to sort.
public static void
Sort​(TKey[] keys, TValue[] items, int index, int length, IComparer?<​TKey> comparer)
Sorts a range of elements in a pair of <see cref="T:System.Array" /> objects (one contains the keys and the other contains the corresponding items) based on the keys in the first <see cref="T:System.Array" /> using the specified <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface.
keys The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the keys to sort.
items The one-dimensional, zero-based <see cref="T:System.Array" /> that contains the items that correspond to the keys in <paramref name="keys" /> , or <see langword="null" /> to sort only <paramref name="keys" /> .
index The starting index of the range to sort.
length The number of elements in the range to sort.
comparer The <see cref="T:System.Collections.Generic.IComparer`1" /> generic interface implementation to use when comparing elements, or <see langword="null" /> to use the <see cref="T:System.IComparable`1" /> generic interface implementation of each element.
public static bool
TrueForAll​(T[] array, Predicate<​T> match)
Determines whether every element in the array matches the conditions defined by the specified predicate.
Returns <see langword="true" /> if every element in <paramref name="array" /> matches the conditions defined by the specified predicate; otherwise, <see langword="false" /> . If there are no elements in the array, the return value is <see langword="true" /> .
array The one-dimensional, zero-based <see cref="T:System.Array" /> to check against the conditions.
match The predicate that defines the conditions to check against the elements.
public bool
Equals​(object obj)
Inherited from object
Determines whether the specified object is equal to the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
obj The object to compare with the current object.
protected void
Finalize​()
Inherited from object
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
public int
GetHashCode​()
Inherited from object
Serves as the default hash function.
Returns A hash code for the current object.
public Type
GetType​()
Inherited from object
Gets the <see cref="T:System.Type" /> of the current instance.
Returns The exact runtime type of the current instance.
protected object
MemberwiseClone​()
Inherited from object
Creates a shallow copy of the current <see cref="T:System.Object" /> .
Returns A shallow copy of the current <see cref="T:System.Object" /> .
public string
ToString​()
Inherited from object
Returns a string that represents the current object.
Returns A string that represents the current object.