Enumerable.ToHashSet Metoda
V tomto článku
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í.
ToHashSet<TSource>(IEnumerable<TSource>) |
Vytvoří z HashSet<T> objektu IEnumerable<T>. |
ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>) |
HashSet<T> Vytvoří z objektu IEnumerable<T> |
- 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
A HashSet<T> obsahující hodnoty typu TSource
vybraného ze vstupní sekvence.
Výjimky
source
je null
.
Viz také
Platí pro
- 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
A HashSet<T> obsahující hodnoty typu TSource
vybraného ze vstupní sekvence.
Výjimky
source
je null
.
Viz také
Platí pro
Zpětná vazba k produktu .NET
.NET je open source projekt. Vyberte odkaz pro poskytnutí zpětné vazby: