Remove item from SortedSet in CSharp

Description

The following code shows how to remove item from SortedSet.

Example


using System;//from   www .  ja v a 2s .c o m
using System.Collections;
using System.Collections.Generic;
using System.IO;

class Program
{
    static void Main(string[] args)
    {
        SortedSet<string> set1 = new SortedSet<string>();
        set1.Add("a");
        set1.Add("b");
        set1.Add("d");
        set1.Add("d");
        
        set1.Remove("a");

        foreach (string s in set1)
        {
            Console.WriteLine(s);
        }
    }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    Collections »




ArrayList
BitArray
Collection
Comparer
HashSet
Hashtable
LinkedList
List
ListDictionary
OrderedDictionary
Queue
SortedList
SortedSet
Stack
StringCollection
StringDictionary