Enumerable.ToHashSet メソッド

定義

オーバーロード

名前 説明
ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)

キーを比較する HashSet<T> を使用して、IEnumerable<T> から comparer を作成します。

ToHashSet<TSource>(IEnumerable<TSource>)

HashSet<T>から IEnumerable<T> を作成します。

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

キーを比較する HashSet<T> を使用して、IEnumerable<T> から comparer を作成します。

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の要素の型。

パラメーター

source
IEnumerable<TSource>

HashSet<T>を作成するIEnumerable<T>

comparer
IEqualityComparer<TSource>

キーを比較する IEqualityComparer<T>

返品

HashSet<TSource>

入力シーケンスから選択HashSet<T>型の値を含むTSource

例外

sourcenullです。

こちらもご覧ください

適用対象

ToHashSet<TSource>(IEnumerable<TSource>)

HashSet<T>から 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の要素の型。

パラメーター

source
IEnumerable<TSource>

HashSet<T>を作成するIEnumerable<T>

返品

HashSet<TSource>

入力シーケンスから選択HashSet<T>型の値を含むTSource

例外

sourcenullです。

こちらもご覧ください

適用対象