SortedList.Keys : SortedList « System.Collections « C# / C Sharp by API






SortedList.Keys

  
using System; 
using System.Collections; 
 
class MainClass { 
  public static void Main() { 
    SortedList sl = new SortedList(); 
     
    sl.Add("a", "A"); 
    sl.Add("b", "B"); 
    sl.Add("c", "C"); 
    sl.Add("d", "D"); 
 
    // Get a collection of the keys. 
    ICollection c = sl.Keys; 
 
    // Display list using integer indexes. 
    Console.WriteLine("Contents by integer indexes."); 
    for(int i=0; i<sl.Count; i++) 
      Console.WriteLine(sl.GetByIndex(i)); 
      
  }
}

   
    
  








Related examples in the same category

1.SortedList.Add
2.SortedList.ContainsValue()
3.SortedList.Count
4.SortedList.GetByIndex
5.SortedList.GetKey
6.SortedList.GetKeyList
7.SortedList.GetValueList
8.SortedList.IndexOfKey
9.SortedList.Remove
10.SortedList.RemoveAt
11.SortedList.Values