Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

HashSet<T>::CopyTo Method (array<T>^, Int32, Int32)

 

Copies the specified number of elements of a HashSet<T> object to an array, starting at the specified array index.

Namespace:   System.Collections.Generic
Assembly:  System.Core (in System.Core.dll)

public:
void CopyTo(
	array<T>^ array,
	int arrayIndex,
	int count
)

Parameters

array
Type: array<T>^

The one-dimensional array that is the destination of the elements copied from the HashSet<T> object. The array must have zero-based indexing.

arrayIndex
Type: System::Int32

The zero-based index in array at which copying begins.

count
Type: System::Int32

The number of elements to copy to array.

Exception Condition
ArgumentNullException

array is null.

ArgumentOutOfRangeException

arrayIndex is less than 0.

-or-

count is less than 0.

ArgumentException

arrayIndex is greater than the length of the destination array.

-or-

count is greater than the available space from the index to the end of the destination array.

This method is an O(n) operation, where n is count.

Universal Windows Platform
Available since 8
.NET Framework
Available since 3.5
Portable Class Library
Supported in: portable .NET platforms
Silverlight
Available since 4.0
Windows Phone Silverlight
Available since 8.0
Windows Phone
Available since 8.1
Return to top
Show:
© 2017 Microsoft