SortedDictionary.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > SortedDictionary.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains メソッドの意味・解説 

SortedDictionary.KeyCollection.System.Collections.Generic.ICollection.Contains メソッド

メモ : このメソッドは、.NET Framework version 2.0 で新しく追加されたものです。

指定した値が ICollection に格納されているかどうかを判断します。

名前空間: System.Collections.Generic
アセンブリ: System (system.dll 内)
構文構文

Private Function System.Collections.Generic.ICollection<TKey>.Contains
 ( _
    item As TKey _
) As Boolean Implements
 ICollection(Of TKey).Contains
bool ICollection<TKey>.Contains (
    TKey item
)
private:
virtual bool System.Collections.Generic.ICollection<TKey>.Contains
 (
    TKey item
) sealed = ICollection<TKey>::Contains

パラメータ

item

ICollection 内で検索するオブジェクト。

戻り値
item が ICollection に存在する場合は true。それ以外の場合は false。

解説解説

オブジェクトが等しいかどうかを判断する方法で実装が異なります。たとえば、List では Comparer.Default が使用されます。また、SortedDictionary では、IComparer 実装をキーの比較に使うかどうかをユーザーが指定できます。

このメソッドは O(1) 操作です。

プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
SortedDictionary.KeyCollection ジェネリック クラス
SortedDictionary.KeyCollection メンバ
System.Collections.Generic 名前空間



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

SortedDictionary.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains メソッドのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



SortedDictionary.KeyCollection.System.Collections.Generic.ICollection<TKey>.Contains メソッドのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS