21
1
using System;
2
using System.Collections.Generic;
3
4
public class Program
5
{
6
#nullable enable
7
public static void Main()
8
{
9
SortedList<string, string> sortedStringList = new SortedList<string, string>();
10
11
sortedStringList.Add("test", "test");
12
sortedStringList.Add("testTwo", "testTwo");
13
sortedStringList.Add("testThree", "testThree");
14
sortedStringList.Add("testFour", "test"); // this wiill be the second item in the list
15
16
foreach(KeyValuePair<string, string> sortedString in sortedStringList)
17
{
18
Console.WriteLine($"{sortedString.Key}: {sortedString.Value}");
19
}
20
}
21
}
Cached Result
null