Enumerable.ToHashSet Metoda
Definice
Důležité
Některé informace platí pro předběžně vydaný produkt, který se může zásadně změnit, než ho výrobce nebo autor vydá. Microsoft neposkytuje žádné záruky, výslovné ani předpokládané, týkající se zde uváděných informací.
Přetížení
| Name | Description |
|---|---|
| ToHashSet<TSource>(IEnumerable<TSource>) |
Vytvoří HashSet<T> z IEnumerable<T>. |
| ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>) |
Vytvoří HashSet<T> z IEnumerable<T> pomocí |
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
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
A HashSet<T> , který obsahuje hodnoty typu TSource vybrané ze vstupní sekvence.
Výjimky
source je null.