class Array
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime.
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 interface implemented by each element of the array and by the specified value.
arrayThe sorted one-dimensional 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 in the specified , if is found; otherwise, a negative number. If is not found and is less than one or more elements in , the negative number returned is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than all elements in , 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 , the return value can be incorrect and a negative number could be returned, even if is present in .
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 interface.
arrayThe sorted one-dimensional to search.indexThe starting index of the range to search.lengthThe length of the range to search.valueThe object to search for.comparerThe implementation to use when comparing elements. -or- to use the implementation of each element.- Returns The index of the specified in the specified , if is found; otherwise, a negative number. If is not found and is less than one or more elements in , the negative number returned is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than all elements in , 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 , the return value can be incorrect and a negative number could be returned, even if is present in .
public static int BinarySearch( Array array, object value )
Searches an entire one-dimensional sorted array for a specific element, using the interface implemented by each element of the array and by the specified object.
arrayThe sorted one-dimensional to search.valueThe object to search for.- Returns The index of the specified in the specified , if is found; otherwise, a negative number. If is not found and is less than one or more elements in , the negative number returned is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than all elements in , 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 , the return value can be incorrect and a negative number could be returned, even if is present in .
public static int BinarySearch( Array array, object value, IComparer comparer )
Searches an entire one-dimensional sorted array for a value using the specified interface.
arrayThe sorted one-dimensional to search.valueThe object to search for.comparerThe implementation to use when comparing elements. -or- to use the implementation of each element.- Returns The index of the specified in the specified , if is found; otherwise, a negative number. If is not found and is less than one or more elements in , the negative number returned is the bitwise complement of the index of the first element that is larger than . If is not found and is greater than all elements in , 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 , the return value can be incorrect and a negative number could be returned, even if is present in .
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.
arrayThe array whose elements need to be cleared.indexThe starting index of the range of elements to clear.lengthThe number of elements to clear.
public static void ConstrainedCopy( Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length )
Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely.
sourceArrayThe that contains the data to copy.sourceIndexA 32-bit integer that represents the index in the at which copying begins.destinationArrayThe that receives the data.destinationIndexA 32-bit integer that represents the index in the at which storing begins.lengthA 32-bit integer that represents the number of elements to copy.
public static void Copy( Array sourceArray, Array destinationArray, int length )
Copies a range of elements from an starting at the first element and pastes them into another starting at the first element. The length is specified as a 32-bit integer.
sourceArrayThe that contains the data to copy.destinationArrayThe that receives the data.lengthA 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 starting at the first element and pastes them into another starting at the first element. The length is specified as a 64-bit integer.
sourceArrayThe that contains the data to copy.destinationArrayThe that receives the data.lengthA 64-bit integer that represents the number of elements to copy. The integer must be between zero and , inclusive.
public static void Copy( Array sourceArray, int sourceIndex, Array destinationArray, int destinationIndex, int length )
Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 32-bit integers.
sourceArrayThe that contains the data to copy.sourceIndexA 32-bit integer that represents the index in the at which copying begins.destinationArrayThe that receives the data.destinationIndexA 32-bit integer that represents the index in the at which storing begins.lengthA 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 starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 64-bit integers.
sourceArrayThe that contains the data to copy.sourceIndexA 64-bit integer that represents the index in the at which copying begins.destinationArrayThe that receives the data.destinationIndexA 64-bit integer that represents the index in the at which storing begins.lengthA 64-bit integer that represents the number of elements to copy. The integer must be between zero and , 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.
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 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.
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 at which copying begins.
public static Array CreateInstance( Type elementType, int length )
Creates a one-dimensional of the specified and length, with zero-based indexing.
elementTypeThe of the to create.lengthThe size of the to create.- Returns A new one-dimensional of the specified with the specified length, using zero-based indexing.
public static Array CreateInstance( Type elementType, int length1, int length2 )
Creates a two-dimensional of the specified and dimension lengths, with zero-based indexing.
elementTypeThe of the to create.length1The size of the first dimension of the to create.length2The size of the second dimension of the to create.- Returns A new two-dimensional of the specified with the specified length for each dimension, using zero-based indexing.
public static Array CreateInstance( Type elementType, int length1, int length2, int length3 )
Creates a three-dimensional of the specified and dimension lengths, with zero-based indexing.
elementTypeThe of the to create.length1The size of the first dimension of the to create.length2The size of the second dimension of the to create.length3The size of the third dimension of the to create.- Returns A new three-dimensional of the specified with the specified length for each dimension, using zero-based indexing.
public static Array CreateInstance( Type elementType, int[] lengths )
Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers.
elementTypeThe of the to create.lengthsAn array of 32-bit integers that represent the size of each dimension of the to create.- Returns A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing.
public static Array CreateInstance( Type elementType, int[] lengths, int[] lowerBounds )
Creates a multidimensional of the specified and dimension lengths, with the specified lower bounds.
elementTypeThe of the to create.lengthsA one-dimensional array that contains the size of each dimension of the to create.lowerBoundsA one-dimensional array that contains the lower bound (starting index) of each dimension of the to create.- Returns A new multidimensional of the specified with the specified length and lower bound for each dimension.
public static Array CreateInstance( Type elementType, long[] lengths )
Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers.
elementTypeThe of the to create.lengthsAn array of 64-bit integers that represent the size of each dimension of the to create. Each integer in the array must be between zero and , inclusive.- Returns A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing.
public int GetLength( int dimension )
Gets a 32-bit integer that represents the number of elements in the specified dimension of the .
dimensionA zero-based dimension of the whose length needs to be determined.- Returns A 32-bit integer that represents the number of elements in the specified dimension.
public long GetLongLength( int dimension )
Gets a 64-bit integer that represents the number of elements in the specified dimension of the .
dimensionA zero-based dimension of the whose length needs to be determined.- Returns A 64-bit integer that represents the number of elements in the specified dimension.
public int GetLowerBound( int dimension )
Gets the index of the first element of the specified dimension in the array.
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.
public int GetUpperBound( int dimension )
Gets the index of the last element of the specified dimension in the array.
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.
public object GetValue( int index )
Gets the value at the specified position in the one-dimensional . The index is specified as a 32-bit integer.
indexA 32-bit integer that represents the position of the element to get.- Returns The value at the specified position in the one-dimensional .
public object GetValue( int index1, int index2 )
Gets the value at the specified position in the two-dimensional . The indexes are specified as 32-bit integers.
index1A 32-bit integer that represents the first-dimension index of the element to get.index2A 32-bit integer that represents the second-dimension index of the element to get.- Returns The value at the specified position in the two-dimensional .
public object GetValue( int index1, int index2, int index3 )
Gets the value at the specified position in the three-dimensional . The indexes are specified as 32-bit integers.
index1A 32-bit integer that represents the first-dimension index of the element to get.index2A 32-bit integer that represents the second-dimension index of the element to get.index3A 32-bit integer that represents the third-dimension index of the element to get.- Returns The value at the specified position in the three-dimensional .
public object GetValue( int[] indices )
Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers.
indicesA one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to get.- Returns The value at the specified position in the multidimensional .
public object GetValue( long index )
Gets the value at the specified position in the one-dimensional . The index is specified as a 64-bit integer.
indexA 64-bit integer that represents the position of the element to get.- Returns The value at the specified position in the one-dimensional .
public object GetValue( long index1, long index2 )
Gets the value at the specified position in the two-dimensional . The indexes are specified as 64-bit integers.
index1A 64-bit integer that represents the first-dimension index of the element to get.index2A 64-bit integer that represents the second-dimension index of the element to get.- Returns The value at the specified position in the two-dimensional .
public object GetValue( long index1, long index2, long index3 )
Gets the value at the specified position in the three-dimensional . The indexes are specified as 64-bit integers.
index1A 64-bit integer that represents the first-dimension index of the element to get.index2A 64-bit integer that represents the second-dimension index of the element to get.index3A 64-bit integer that represents the third-dimension index of the element to get.- Returns The value at the specified position in the three-dimensional .
public object GetValue( long[] indices )
Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers.
indicesA one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to get.- Returns The value at the specified position in the multidimensional .
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.
arrayThe one-dimensional array to search.valueThe object to locate in .- Returns The index of the first occurrence of in , if found; otherwise, the lower bound of the array minus 1.
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.
arrayThe one-dimensional array to search.valueThe object to locate in .startIndexThe starting index of the search. 0 (zero) is valid in an empty array.- Returns The index of the first occurrence of , if it's found, within the range of elements in that extends from to the last element; otherwise, the lower bound of the array minus 1.
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.
arrayThe one-dimensional array to search.valueThe object to locate in .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 , if it's found in the from index to + - 1; otherwise, the lower bound of the array minus 1.
public bool IsFixedSize { get; }
Gets a value indicating whether the has a fixed size.
- Returns This property is always for all arrays.
public bool IsReadOnly { get; }
Gets a value indicating whether the is read-only.
- Returns This property is always for all arrays.
public bool IsSynchronized { get; }
Gets a value indicating whether access to the is synchronized (thread safe).
- Returns This property is always for all arrays.
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 .
arrayThe one-dimensional to search.valueThe object to locate in .- Returns The index of the last occurrence of within the entire , if found; otherwise, the lower bound of the array minus 1.
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 that extends from the first element to the specified index.
arrayThe one-dimensional to search.valueThe object to locate in .startIndexThe starting index of the backward search.- Returns The index of the last occurrence of within the range of elements in that extends from the first element to , if found; otherwise, the lower bound of the array minus 1.
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 that contains the specified number of elements and ends at the specified index.
arrayThe one-dimensional to search.valueThe object to locate in .startIndexThe starting index of the backward search.countThe number of elements in the section to search.- Returns The index of the last occurrence of within the range of elements in that contains the number of elements specified in and ends at , if found; otherwise, the lower bound of the array minus 1.
public int Length { get; }
Gets the total number of elements in all the dimensions of the .
- Returns The total number of elements in all the dimensions of the ; zero if there are no elements in the array.
public long LongLength { get; }
Gets a 64-bit integer that represents the total number of elements in all the dimensions of the .
- Returns A 64-bit integer that represents the total number of elements in all the dimensions of the .
public int Rank { get; }
Gets the rank (number of dimensions) of the . 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 .
public static void Reverse( Array array )
Reverses the sequence of the elements in the entire one-dimensional .
arrayThe one-dimensional to reverse.
public static void Reverse( Array array, int index, int length )
Reverses the sequence of the elements in a range of elements in the one-dimensional .
arrayThe one-dimensional to reverse.indexThe starting index of the section to reverse.lengthThe 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 . The index is specified as a 32-bit integer.
valueThe new value for the specified element.indexA 32-bit integer that represents the position of the 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 . The indexes are specified as 32-bit integers.
valueThe new value for the specified element.index1A 32-bit integer that represents the first-dimension index of the element to set.index2A 32-bit integer that represents the second-dimension index of the 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 . The indexes are specified as 32-bit integers.
valueThe new value for the specified element.index1A 32-bit integer that represents the first-dimension index of the element to set.index2A 32-bit integer that represents the second-dimension index of the element to set.index3A 32-bit integer that represents the third-dimension index of the element to set.
public void SetValue( object value, int[] indices )
Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers.
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.
public void SetValue( object value, long index )
Sets a value to the element at the specified position in the one-dimensional . The index is specified as a 64-bit integer.
valueThe new value for the specified element.indexA 64-bit integer that represents the position of the 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 . The indexes are specified as 64-bit integers.
valueThe new value for the specified element.index1A 64-bit integer that represents the first-dimension index of the element to set.index2A 64-bit integer that represents the second-dimension index of the 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 . The indexes are specified as 64-bit integers.
valueThe new value for the specified element.index1A 64-bit integer that represents the first-dimension index of the element to set.index2A 64-bit integer that represents the second-dimension index of the element to set.index3A 64-bit integer that represents the third-dimension index of the element to set.
public void SetValue( object value, long[] indices )
Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers.
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.
public static void Sort( Array array )
Sorts the elements in an entire one-dimensional using the implementation of each element of the .
arrayThe one-dimensional to sort.
public static void Sort( Array keys, Array items )
Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key.
keysThe one-dimensional that contains the keys to sort.itemsThe one-dimensional that contains the items that correspond to each of the keys in the . -or- to sort only the .
public static void Sort( Array keys, Array items, IComparer comparer )
Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified .
keysThe one-dimensional that contains the keys to sort.itemsThe one-dimensional that contains the items that correspond to each of the keys in the . -or- to sort only the .comparerThe implementation to use when comparing elements. -or- to use the 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 objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key.
keysThe one-dimensional that contains the keys to sort.itemsThe one-dimensional that contains the items that correspond to each of the keys in the . -or- to sort only the .indexThe starting index of the range to sort.lengthThe 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 objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified .
keysThe one-dimensional that contains the keys to sort.itemsThe one-dimensional that contains the items that correspond to each of the keys in the . -or- to sort only the .indexThe starting index of the range to sort.lengthThe number of elements in the range to sort.comparerThe implementation to use when comparing elements. -or- to use the implementation of each element.
public static void Sort( Array array, IComparer comparer )
Sorts the elements in a one-dimensional using the specified .
arrayThe one-dimensional array to sort.comparerThe implementation to use when comparing elements. -or- to use the 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 using the implementation of each element of the .
arrayThe one-dimensional to sort.indexThe starting index of the range to sort.lengthThe 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 using the specified .
arrayThe one-dimensional to sort.indexThe starting index of the range to sort.lengthThe number of elements in the range to sort.comparerThe implementation to use when comparing elements. -or- to use the implementation of each element.
public object SyncRoot { get; }
Gets an object that can be used to synchronize access to the .
- Returns An object that can be used to synchronize access to the .
public IEnumerator GetEnumerator( )
😔 No documentation found.
public static int MaxLength { get; }
😔 No documentation found.
public static int LastIndexOf( T[] array, T value, int startIndex )
😔 No documentation found.
public string ToString( )
😔 No documentation found.
public static void Reverse( T[] array )
😔 No documentation found.
public static int LastIndexOf( T[] array, T value, int startIndex, int count )
😔 No documentation found.
public Type GetType( )
😔 No documentation found.
public int GetHashCode( )
😔 No documentation found.
public static void Sort( TKey[] keys, TValue[] items )
😔 No documentation found.
public static void Sort( T[] array, int index, int length )
😔 No documentation found.
public static void Sort( TKey[] keys, TValue[] items, int index, int length )
😔 No documentation found.
public static void Sort( T[] array, IComparer<T> comparer )
😔 No documentation found.
public static void Sort( TKey[] keys, TValue[] items, IComparer<TKey> comparer )
😔 No documentation found.
public static void Sort( T[] array, int index, int length, IComparer<T> comparer )
😔 No documentation found.
public static void Sort( TKey[] keys, TValue[] items, int index, int length, IComparer<TKey> comparer )
😔 No documentation found.
public static void Sort( T[] array, Comparison<T> comparison )
😔 No documentation found.
public static bool TrueForAll( T[] array, Predicate<T> match )
😔 No documentation found.
public static void Reverse( T[] array, int index, int length )
😔 No documentation found.
public static void Sort( T[] array )
😔 No documentation found.
public static void Fill( T[] array, T value, int startIndex, int count )
😔 No documentation found.
public static void Resize( ref T[] array, int newSize )
😔 No documentation found.
public static Array CreateInstanceFromArrayType( Type arrayType, int length )
😔 No documentation found.
public static Array CreateInstanceFromArrayType( Type arrayType, int[] lengths )
😔 No documentation found.
public static Array CreateInstanceFromArrayType( Type arrayType, int[] lengths, int[] lowerBounds )
😔 No documentation found.
public void Initialize( )
😔 No documentation found.
public static void Clear( Array array )
😔 No documentation found.
public static int BinarySearch( T[] array, T value )
😔 No documentation found.
public static int BinarySearch( T[] array, T value, IComparer<T> comparer )
😔 No documentation found.
public static int BinarySearch( T[] array, int index, int length, T value )
😔 No documentation found.
public static int BinarySearch( T[] array, int index, int length, T value, IComparer<T> comparer )
😔 No documentation found.
public static TOutput[] ConvertAll( TInput[] array, Converter<TInput,TOutput> converter )
😔 No documentation found.
public bool Equals( object obj )
😔 No documentation found.
public static T[] Empty( )
😔 No documentation found.
public static bool Exists( T[] array, Predicate<T> match )
😔 No documentation found.
public static void Fill( T[] array, T value )
😔 No documentation found.
public static ReadOnlyCollection<T> AsReadOnly( T[] array )
😔 No documentation found.
public static T Find( T[] array, Predicate<T> match )
😔 No documentation found.
public static T[] FindAll( T[] array, Predicate<T> match )
😔 No documentation found.
public static int FindIndex( T[] array, Predicate<T> match )
😔 No documentation found.
public static int FindIndex( T[] array, int startIndex, Predicate<T> match )
😔 No documentation found.
public static int FindIndex( T[] array, int startIndex, int count, Predicate<T> match )
😔 No documentation found.
public static T FindLast( T[] array, Predicate<T> match )
😔 No documentation found.
public static int FindLastIndex( T[] array, Predicate<T> match )
😔 No documentation found.
public static int FindLastIndex( T[] array, int startIndex, Predicate<T> match )
😔 No documentation found.
public static int FindLastIndex( T[] array, int startIndex, int count, Predicate<T> match )
😔 No documentation found.
public static void ForEach( T[] array, Action<T> action )
😔 No documentation found.
public static int IndexOf( T[] array, T value )
😔 No documentation found.
public static int IndexOf( T[] array, T value, int startIndex )
😔 No documentation found.
public static int LastIndexOf( T[] array, T value )
😔 No documentation found.
public static int IndexOf( T[] array, T value, int startIndex, int count )
😔 No documentation found.