語言

OrderedDictionary<TKey,TValue>.IndexOf(TKey) 方法

定義

決定特定鍵的 OrderedDictionary<TKey,TValue>索引。

public:
 int IndexOf(TKey key);
public int IndexOf(TKey key);
member this.IndexOf : 'Key -> int
Public Function IndexOf (key As TKey) As Integer

參數

key
TKey

找到的關鍵。

傳回

若找到,則為 的 key 索引;否則為 -1。

例外狀況

key 是 null。

適用於