C# SortedSet SortedSet(IComparer)
Description
SortedSet
initializes
a new instance of the SortedSet
Syntax
public SortedSet(
IComparer<T> comparer
)
Parameters
comparer
- The default comparer to use for comparing objects.
Example
// w w w . j a v a 2s .c om
using System;
using System.Collections.Generic;
public class MainClass {
public static void Main() {
SortedSet<String> s = new SortedSet<string>(new My());
}
}
public class My : IComparer<string>
{
public int Compare(string x, string y)
{
return 1;
}
}