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






SortedList.Count

  
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.GetByIndex
4.SortedList.GetKey
5.SortedList.GetKeyList
6.SortedList.GetValueList
7.SortedList.IndexOfKey
8.SortedList.Keys
9.SortedList.Remove
10.SortedList.RemoveAt
11.SortedList.Values