HashSet.CopyTo Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Copies the elements of a HashSet
Overloads
| Name | Description |
|---|---|
| CopyTo(T[]) |
Copies the elements of a HashSet |
| CopyTo(T[], Int32) |
Copies the elements of a HashSet |
| CopyTo(T[], Int32, Int32) |
Copies the specified number of elements of a HashSet |
CopyTo(T[])
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
Copies the elements of a HashSet
public:
void CopyTo(cli::array ^ array);
public void CopyTo(T[] array);
member this.CopyTo : 'T[] -> unit
Public Sub CopyTo (array As T())
Parameters
- array
- T[]
The one-dimensional array that is the destination of the elements copied from the HashSet
Exceptions
array is null.
Remarks
This method is an O(n) operation, where n is Count.
Applies to
CopyTo(T[], Int32)
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
Copies the elements of a HashSet
public:
virtual void CopyTo(cli::array ^ array, int arrayIndex);
public void CopyTo(T[] array, int arrayIndex);
abstract member CopyTo : 'T[] * int -> unit
override this.CopyTo : 'T[] * int -> unit
Public Sub CopyTo (array As T(), arrayIndex As Integer)
Parameters
- array
- T[]
The one-dimensional array that is the destination of the elements copied from the HashSet
- arrayIndex
- Int32
The zero-based index in array at which copying begins.
Implements
Exceptions
array is null.
arrayIndex is less than 0.
arrayIndex is greater than the length of the destination array.
Remarks
This method is an O(n) operation, where n is Count.
Applies to
CopyTo(T[], Int32, Int32)
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
- Source:
- HashSet.cs
Copies the specified number of elements of a HashSet
public:
void CopyTo(cli::array ^ array, int arrayIndex, int count);
public void CopyTo(T[] array, int arrayIndex, int count);
member this.CopyTo : 'T[] * int * int -> unit
Public Sub CopyTo (array As T(), arrayIndex As Integer, count As Integer)
Parameters
- array
- T[]
The one-dimensional array that is the destination of the elements copied from the HashSet
- arrayIndex
- Int32
The zero-based index in array at which copying begins.
- count
- Int32
The number of elements to copy to array.
Exceptions
array is null.
arrayIndex is greater than the length of the destination array.
-or-
count is greater than the available space from arrayIndex to the end of the destination array.
Remarks
This method is an O(n) operation, where n is count.