Enumerable.ToHashSet Méthode
Définition
Surcharges
ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>) |
Crée un HashSet<T> à partir d’un IEnumerable<T> en utilisant |
ToHashSet<TSource>(IEnumerable<TSource>) |
Crée un HashSet<T> à partir d’un IEnumerable<T>.Creates a HashSet<T> from an IEnumerable<T>. |
ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)
Crée un HashSet<T> à partir d’un IEnumerable<T> en utilisant comparer
pour comparer des clés.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)
Paramètres de type
- TSource
Le type des éléments de source
.The type of the elements of source
.
Paramètres
- source
- IEnumerable<TSource>
IEnumerable<T> à partir duquel créer un HashSet<T>.An IEnumerable<T> to create a HashSet<T> from.
- comparer
- IEqualityComparer<TSource>
IEqualityComparer<T> pour comparer les clés.An IEqualityComparer<T> to compare keys.
Retours
- HashSet<TSource>
HashSet<T> qui contient des valeurs de type TSource
sélectionnées dans la séquence d’entrée.A HashSet<T> that contains values of type TSource
selected from the input sequence.
S’applique à
ToHashSet<TSource>(IEnumerable<TSource>)
Crée un HashSet<T> à partir d’un 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)
Paramètres de type
- TSource
Le type des éléments de source
.The type of the elements of source
.
Paramètres
- source
- IEnumerable<TSource>
IEnumerable<T> à partir duquel créer un HashSet<T>.An IEnumerable<T> to create a HashSet<T> from.
Retours
- HashSet<TSource>
HashSet<T> qui contient des valeurs de type TSource sélectionnées dans la séquence d’entrée.A HashSet<T> that contains values of type TSource selected from the input sequence.