Add to SortedList, get by key and index
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
class Program {
static void Main(string[] args) {
SortedList footballTeams = new SortedList();
footballTeams.Add(1, "S");
footballTeams.Add(2, "K");
footballTeams.Add(3, "I");
for (int i = 0; i < footballTeams.Count; i++) {
Console.WriteLine("KEY: " + footballTeams.GetKey(i) +
" VALUE: " + footballTeams.GetByIndex(i));
}
}
}
Related examples in the same category