Check if a SortedSet is a superset of the specified collection in CSharp
Description
The following code shows how to check if a SortedSet is a superset of the specified collection.
Example
using System;//from www .ja v a 2s.c om
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");
SortedSet<string> set2 = new SortedSet<string>();
set2.Add("a");
set2.Add("b");
set2.Add("c");
set2.Add("d");
Console.WriteLine(set1.IsSupersetOf(set2));
}
}
The code above generates the following result.