语言

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。

适用于