Gets the index of a key.
The index of the key. If the key is not found, -1 is returned.
Hashtable hashTable = new Hashtable();
hashTable.Add("0", "apples");
hashTable.Add("1", "bananas");
hashTable.Add("2", "pears");
int bananaKey = hashTable.IndexOf("1");
HashList Class | Sitecore.Collections Namespace