Get the number of key/value pairs contained in the ListDictionary in CSharp
Description
The following code shows how to get the number of key/value pairs contained in the ListDictionary.
Example
using System;/* w w w. j a va 2 s .com*/
using System.Collections;
using System.Collections.Specialized;
public class SamplesListDictionary {
public static void Main() {
ListDictionary myCol = new ListDictionary();
myCol.Add( "F", "1.49" );
myCol.Add( "A", "1.29" );
myCol.Add( "B", "1.49" );
myCol.Add( "C", "1.29" );
myCol.Add( "D", "0.89" );
myCol.Add( "E", "0.99" );
Console.WriteLine(myCol.Count);
}
}
The code above generates the following result.