HashSet<T>.CopyTo Method (T[])

 

Copies the elements of a HashSet<T> object to an array.

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

public void CopyTo(
	T[] array
)

Parameters

array
Type: 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.

Exception Condition
ArgumentNullException

array is null.

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: