Get the number of key/value pairs in the StringDictionary in CSharp
Description
The following code shows how to get the number of key/value pairs in the StringDictionary.
Example
using System;/*from ww w. ja va 2s.c o m*/
using System.Collections;
using System.Collections.Specialized;
public class SamplesStringDictionary {
public static void Main() {
StringDictionary myCol = new StringDictionary();
myCol.Add( "red", "rojo" );
myCol.Add( "green", "verde" );
myCol.Add( "blue", "azul" );
Console.WriteLine( myCol.Count );
}
}
The code above generates the following result.