Enumerable.ToHashSet Metode

Definisi

Overload

ToHashSet<TSource>(IEnumerable<TSource>)

HashSet<T> Membuat dari IEnumerable<T>.

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

HashSet<T> Membuat dari IEnumerable<T> menggunakan comparer untuk membandingkan kunci.

ToHashSet<TSource>(IEnumerable<TSource>)

Source:
ToCollection.cs
Source:
ToCollection.cs
Source:
ToCollection.cs

HashSet<T> Membuat dari 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)

Jenis parameter

TSource

Jenis elemen source.

Parameter

source
IEnumerable<TSource>

Untuk IEnumerable<T> membuat HashSet<T> dari.

Mengembalikan

HashSet<TSource>

HashSet<T> yang berisi nilai jenis TSource yang dipilih dari urutan input.

Pengecualian

sourceadalah null.

Lihat juga

Berlaku untuk

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

Source:
ToCollection.cs
Source:
ToCollection.cs
Source:
ToCollection.cs

HashSet<T> Membuat dari IEnumerable<T> menggunakan comparer untuk membandingkan kunci.

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)

Jenis parameter

TSource

Jenis elemen source.

Parameter

source
IEnumerable<TSource>

Untuk IEnumerable<T> membuat HashSet<T> dari.

comparer
IEqualityComparer<TSource>

Untuk IEqualityComparer<T> membandingkan kunci.

Mengembalikan

HashSet<TSource>

HashSet<T> yang berisi nilai jenis TSource yang dipilih dari urutan input.

Pengecualian

sourceadalah null.

Lihat juga

Berlaku untuk