ServiceCollection.Contains(String) 方法

定義

檢查指定的索引鍵值是否存在集合中。

public:
 bool Contains(System::String ^ key);
public bool Contains (string key);
member this.Contains : string -> bool
Public Function Contains (key As String) As Boolean

參數

key
String

String 值,指定要在集合中檢查其存在與否的索引鍵值。

傳回

Boolean

Boolean 值,指定索引鍵值是否存在集合內。

如果為 True,則索引鍵值存在集合內。

如果為 False,則索引鍵值不存在集合內。

範例

使用集合

適用於