Enumerable.ToHashSet Metoda

Definice

Přetížení

ToHashSet<TSource>(IEnumerable<TSource>)

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

Vytvoří HashSet<T> z 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ů .source

Parametry

source
IEnumerable<TSource>

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

Návraty

HashSet<TSource>

A HashSet<T> , který obsahuje hodnoty typu TSource vybrané 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
Zdroj:
ToCollection.cs
Zdroj:
ToCollection.cs

Vytvoří HashSet<T> z IEnumerable<T> pomocí comparer 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ů .source

Parametry

source
IEnumerable<TSource>

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

comparer
IEqualityComparer<TSource>

Porovnávat IEqualityComparer<T> klíče.

Návraty

HashSet<TSource>

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

Výjimky

source je null.

Viz také

Platí pro