Sitecore 5.0 API

HashList.GetKey Method 

Gets a key by an index.

[Visual Basic]
Public Function GetKey( _
   ByVal index As Integer _
) As String
[C#]
public string GetKey(
   int index
);

Parameters

index
An index into the hash table.

Return Value

Returns the key at the index'ed position. If the index is less than zero or greater than the length of the table, blank is returned.

Example

  Hashtable hashTable = new Hashtable();
  hashTable.Add("0", "apples");
  hashTable.Add("1", "bananas");
  hashTable.Add("2", "pears");
  
  string bananaKey = hashTable.GetKey(1);

See Also

HashList Class | Sitecore.Collections Namespace