C# HybridDictionary Keys
Description
HybridDictionary Keys
gets an ICollection containing
the keys in the HybridDictionary.
Syntax
HybridDictionary.Keys
has the following syntax.
public ICollection Keys { get; }
Example
using System;/*from w ww.ja v a 2 s. c o m*/
using System.Collections;
using System.Collections.Specialized;
public class SamplesHybridDictionary {
public static void Main() {
// Creates and initializes a new HybridDictionary.
HybridDictionary myCol = new HybridDictionary();
myCol.Add( "F", "1.49" );
myCol.Add( "A", "1.29" );
String[] myKeys = new String[myCol.Count];
myCol.Keys.CopyTo( myKeys, 0 );
for ( int i = 0; i < myCol.Count; i++ )
Console.WriteLine( " {0,-5} {1,-25} {2}", i, myKeys[i], myCol[myKeys[i]] );
}
}
The code above generates the following result.