Essential C# Overview of C# collections  Suggest an edit

SortedSetT

// create an empty set
var mySet = new SortedSet<int>();

// add something
// note that we add 2 before we add 1
mySet.Add(2);
mySet.Add(1);

// enumerate through the set
foreach(var item in mySet)
{
    Console.WriteLine(item);
}

// output:
// 1
// 2


Table Of Contents
22 Enum
24 Overview of C# collections
25 GUID
107 Stream
108 Timers
  ↑ ↓ to navigate     ↵ to select     Esc to close