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
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
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
object
Clone​() Returns A shallow copy of the <see cref="T:System.Array" /> .
Creates a shallow copy of the <see cref="T:System.Array" /> .
public
void
CopyTo​(Array array,
int index)
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.
Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 32-bit integer.
public
void
CopyTo​(Array array,
long index)
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.
Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 64-bit integer.
public
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)
dimension
A zero-based dimension of the <see cref="T:System.Array" /> whose length needs to be determined.
Returns A 32-bit integer that represents the number of elements in the specified dimension.
Gets a 32-bit integer that represents the number of elements in the specified dimension of the <see cref="T:System.Array" /> .
public
long
GetLongLength​(int dimension)
dimension
A zero-based dimension of the <see cref="T:System.Array" /> whose length needs to be determined.
Returns A 64-bit integer that represents the number of elements in the specified dimension.
Gets a 64-bit integer that represents the number of elements in the specified dimension of the <see cref="T:System.Array" /> .
public
int
GetLowerBound​(int dimension)
dimension
A 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.
Gets the index of the first element of the specified dimension in the array.
public
int
GetUpperBound​(int dimension)
dimension
A 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.
Gets the index of the last element of the specified dimension in the array.
public
object
GetValue​(int index)
index
A 32-bit integer that represents the position of the <see cref="T:System.Array" /> element to get.
Returns The value at the specified position in the one-dimensional <see cref="T:System.Array" /> .
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.
public
object
GetValue​(int index1,
int index2)
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.
Returns The value at the specified position in the two-dimensional <see cref="T:System.Array" /> .
Gets the value at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
public
object
GetValue​(int index1,
int index2,
int index3)
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.
Returns The value at the specified position in the three-dimensional <see cref="T:System.Array" /> .
Gets the value at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 32-bit integers.
public
object
GetValue​(int[] indices)
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.
Returns The value at the specified position in the multidimensional <see cref="T:System.Array" /> .
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.
public
object
GetValue​(long index)
index
A 64-bit integer that represents the position of the <see cref="T:System.Array" /> element to get.
Returns The value at the specified position in the one-dimensional <see cref="T:System.Array" /> .
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.
public
object
GetValue​(long index1,
long index2)
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.
Returns The value at the specified position in the two-dimensional <see cref="T:System.Array" /> .
Gets the value at the specified position in the two-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
public
object
GetValue​(long index1,
long index2,
long index3)
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.
Returns The value at the specified position in the three-dimensional <see cref="T:System.Array" /> .
Gets the value at the specified position in the three-dimensional <see cref="T:System.Array" /> . The indexes are specified as 64-bit integers.
public
object
GetValue​(long[] indices)
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.
Returns The value at the specified position in the multidimensional <see cref="T:System.Array" /> .
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.
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
void
SetValue​(object value,
int index)
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.
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.
public
void
SetValue​(object value,
int index1,
int index2)
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.
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.
public
void
SetValue​(object value,
int index1,
int index2,
int index3)
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.
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.
public
void
SetValue​(object value,
int[] indices)
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.
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.
public
void
SetValue​(object value,
long index)
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.
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.
public
void
SetValue​(object value,
long index1,
long index2)
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.
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.
public
void
SetValue​(object value,
long index1,
long index2,
long index3)
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.
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.
public
void
SetValue​(object value,
long[] indices)
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.
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.
public
bool
Equals​(object obj)
Inherited from object
obj
The object to compare with the current object.
Returns <see langword="true" /> if the specified object is equal to the current object; otherwise, <see langword="false" /> .
Determines whether the specified object is equal to 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
Returns A hash code for the current object.
Serves as the default hash function.
public
Type
GetType​()
Inherited from object
Returns The exact runtime type of the current instance.
Gets the <see cref="T:System.Type" /> of the current instance.
protected
object
MemberwiseClone​()
Inherited from object
Returns A shallow copy of the current <see cref="T:System.Object" /> .
Creates 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.