C# OrderedDictionary Item[Int32]

Description

OrderedDictionary Item[Int32] gets or sets the value at the specified index.

Syntax

OrderedDictionary.Item[Int32] has the following syntax.


public Object this[
  int index
] { get; set; }

Parameters

OrderedDictionary.Item[Int32] has the following parameters.

  • index - The zero-based index of the value to get or set.

Example


using System;//from  w ww.  ja v  a2 s .co  m
using System.Collections;
using System.Collections.Specialized;

public class SamplesStringCollection  {

   public static void Main()  {
        OrderedDictionary myOrderedDictionary = new OrderedDictionary();
        myOrderedDictionary.Add("testKey1", "testValue1");
        myOrderedDictionary.Add("testKey2", "testValue2");
        myOrderedDictionary.Add("keyToDelete", "valueToDelete");
        myOrderedDictionary.Add("testKey3", "testValue3");
        Console.WriteLine( myOrderedDictionary[0]);
   }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.Collections.Specialized »




BitVector32
HybridDictionary
ListDictionary
OrderedDictionary
StringCollection
StringDictionary
StringEnumerator