Clear Method

HashSet(Of T).Clear Method

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Removes all elements from a HashSet(Of T) object.

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

'Declaration
Public Sub Clear

Implements

ICollection(Of T).Clear

Count is set to zero and references to other objects from elements of the collection are also released. The capacity remains unchanged until a call to TrimExcess is made.

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

Windows Phone OS

Supported in: 8.1, 8.0

Show:
© 2017 Microsoft