Enumerable.ToHashSet メソッド

定義

オーバーロード

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

comparer を使用して IEnumerable<T>から HashSet<T> を作成し、キーを比較します。Creates a HashSet<T> from an IEnumerable<T> using the comparer to compare keys.

ToHashSet<TSource>(IEnumerable<TSource>)

IEnumerable<T> から HashSet<T> を作成します。Creates a HashSet<T> from an IEnumerable<T>.

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

comparer を使用して IEnumerable<T>から HashSet<T> を作成し、キーを比較します。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);
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)

型パラメーター

TSource

source の要素の型。The type of the elements of source.

パラメーター

source
IEnumerable<TSource>

HashSet<T> の作成元の IEnumerable<T>An IEnumerable<T> to create a HashSet<T> from.

comparer
IEqualityComparer<TSource>

キーを比較する IEqualityComparer<T>An IEqualityComparer<T> to compare keys.

戻り値

HashSet<TSource>

入力シーケンスから選択された TSource 型の値を格納する HashSet<T>A HashSet<T> that contains values of type TSource selected from the input sequence.

ToHashSet<TSource>(IEnumerable<TSource>)

IEnumerable<T> から HashSet<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)

型パラメーター

TSource

source の要素の型。The type of the elements of source.

パラメーター

source
IEnumerable<TSource>

HashSet<T> の作成元の IEnumerable<T>An IEnumerable<T> to create a HashSet<T> from.

戻り値

HashSet<TSource>

入力シーケンスから選択された TSource 型の値を格納する HashSet<T>A HashSet<T> that contains values of type TSource selected from the input sequence.

適用対象