C# SortedSet IsProperSubsetOf
Description
SortedSet
determines whether
a SortedSet
Syntax
SortedSet.IsProperSubsetOf
has the following syntax.
public bool IsProperSubsetOf(
IEnumerable<T> other
)
Parameters
SortedSet.IsProperSubsetOf
has the following parameters.
other
- The collection to compare to the current SortedSetobject.
Returns
SortedSet.IsProperSubsetOf
method returns true if the SortedSet
object is a proper subset of other; otherwise, false.
Example
using System;//from w w w . j a va 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");
SortedSet<string> set2 = new SortedSet<string>();
set2.Add("a");
set2.Add("b");
set2.Add("c");
set2.Add("d");
Console.WriteLine(set1.IsProperSubsetOf(set2));
}
}
The code above generates the following result.