Enumerable.ToHashSet Metoda

Definicja

Przeciążenia

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

Tworzy HashSet<T> z IEnumerable<T> przy użyciu comparer do porównywania kluczy.Creates a HashSet<T> from an IEnumerable<T> using the comparer to compare keys.

ToHashSet<TSource>(IEnumerable<TSource>)

Tworzy HashSet<T> z IEnumerable<T> .Creates a HashSet<T> from an IEnumerable<T>.

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

Tworzy HashSet<T> z IEnumerable<T> przy użyciu comparer do porównywania kluczy.Creates a HashSet<T> from an IEnumerable<T> using the comparer to compare keys.

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 elementów source .The type of the elements of source.

Parametry

source
IEnumerable<TSource>

IEnumerable<T>W celu utworzenia elementu HashSet<T> z.An IEnumerable<T> to create a HashSet<T> from.

comparer
IEqualityComparer<TSource>

IEqualityComparer<T>Do porównywania kluczy.An IEqualityComparer<T> to compare keys.

Zwraca

HashSet<TSource>

A HashSet<T> , który zawiera wartości typu TSource wybrane z sekwencji wejściowej.A HashSet<T> that contains values of type TSource selected from the input sequence.

Dotyczy

ToHashSet<TSource>(IEnumerable<TSource>)

Tworzy HashSet<T> z IEnumerable<T> .Creates a HashSet<T> from an 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 elementów source .The type of the elements of source.

Parametry

source
IEnumerable<TSource>

IEnumerable<T>W celu utworzenia elementu HashSet<T> z.An IEnumerable<T> to create a HashSet<T> from.

Zwraca

HashSet<TSource>

A HashSet<T> , który zawiera wartości typu TSource wybrane z sekwencji wejściowej.A HashSet<T> that contains values of type TSource selected from the input sequence.

Dotyczy