C# ListDictionary Count
Description
ListDictionary Count
gets the number of key/value pairs
contained in the ListDictionary.
Syntax
ListDictionary.Count
has the following syntax.
public int Count { get; }
Example
The following code example enumerates the elements of a ListDictionary.
/* ww w.j av a 2s.com*/
using System;
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.