Enumerable.ToHashSet Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Overload
| ToHashSet<TSource>(IEnumerable<TSource>) |
HashSet<T> Membuat dari IEnumerable<T>. |
| ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>) |
HashSet<T> Membuat dari IEnumerable<T> menggunakan |
ToHashSet<TSource>(IEnumerable<TSource>)
- Sumber:
- ToCollection.cs
- Sumber:
- ToCollection.cs
- Sumber:
- 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<T> yang berisi nilai jenis TSource yang dipilih dari urutan input.
Pengecualian
sourceadalah null.
Lihat juga
Berlaku untuk
ToHashSet<TSource>(IEnumerable<TSource>, IEqualityComparer<TSource>)
- Sumber:
- ToCollection.cs
- Sumber:
- ToCollection.cs
- Sumber:
- 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<T> yang berisi nilai jenis TSource yang dipilih dari urutan input.
Pengecualian
sourceadalah null.