Method First
First<T>(HashSet<T>)
Gets the first element of a HashSet.
Declaration
public static T First<T>(this HashSet<T> set)
Parameters
| Type | Name | Description |
|---|---|---|
| HashSet<T> | set | Set to retrieve the element from |
Returns
| Type | Description |
|---|---|
| T | The first element in the set |
Type Parameters
| Name | Description |
|---|---|
| T | Type contained in the set |
Remarks
Equivalent to the System.Linq .First() method, but does not allocate.