Enumerable.ToHashSet Metoda

Definice

Přetížení

ToHashSet<TSource>(IEnumerable<TSource>)

Vytvoří z HashSet<T> objektu IEnumerable<T>.

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

HashSet<T> Vytvoří z objektu IEnumerable<T>comparer pomocí příkazu k porovnání klíčů.

ToHashSet<TSource>(IEnumerable<TSource>)

Zdroj:
ToCollection.cs
Zdroj:
ToCollection.cs
Zdroj:
ToCollection.cs

Vytvoří z HashSet<T> objektu IEnumerable<T>.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::HashSet<TSource> ^ ToHashSet(System::Collections::Generic::IEnumerable<TSource> ^ source);
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source);
static member ToHashSet : seq<'Source> -> System.Collections.Generic.HashSet<'Source>
<Extension()>
Public Function ToHashSet(Of TSource) (source As IEnumerable(Of TSource)) As HashSet(Of TSource)

Parametry typu

TSource

Typ prvků objektu source.

Parametry

source
IEnumerable<TSource>

Chcete-li IEnumerable<T>HashSet<T> vytvořit z.

Návraty

HashSet<TSource>

A HashSet<T> , který obsahuje hodnoty typu TSource vybraného ze vstupní sekvence.

Výjimky

source je null.

Viz také

Platí pro

ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

Zdroj:
ToCollection.cs
Zdroj:
ToCollection.cs
Zdroj:
ToCollection.cs

HashSet<T> Vytvoří z objektu IEnumerable<T>comparer pomocí příkazu k porovnání klíčů.

public:
generic <typename TSource>
[System::Runtime::CompilerServices::Extension]
 static System::Collections::Generic::HashSet<TSource> ^ ToHashSet(System::Collections::Generic::IEnumerable<TSource> ^ source, System::Collections::Generic::IEqualityComparer<TSource> ^ comparer);
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource>? comparer);
public static System.Collections.Generic.HashSet<TSource> ToHashSet<TSource> (this System.Collections.Generic.IEnumerable<TSource> source, System.Collections.Generic.IEqualityComparer<TSource> comparer);
static member ToHashSet : seq<'Source> * System.Collections.Generic.IEqualityComparer<'Source> -> System.Collections.Generic.HashSet<'Source>
<Extension()>
Public Function ToHashSet(Of TSource) (source As IEnumerable(Of TSource), comparer As IEqualityComparer(Of TSource)) As HashSet(Of TSource)

Parametry typu

TSource

Typ prvků objektu source.

Parametry

source
IEnumerable<TSource>

Chcete-li IEnumerable<T>HashSet<T> vytvořit z.

comparer
IEqualityComparer<TSource>

K IEqualityComparer<T> porovnání klíčů.

Návraty

HashSet<TSource>

A HashSet<T> , který obsahuje hodnoty typu TSource vybraného ze vstupní sekvence.

Výjimky

source je null.

Viz také

Platí pro