StringComparer.IsWellKnownOrdinalComparer Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Determines whether the specified IEqualityComparer<T> is a well-known ordinal string comparer.
public:
static bool IsWellKnownOrdinalComparer(System::Collections::Generic::IEqualityComparer<System::String ^> ^ comparer, [Runtime::InteropServices::Out] bool % ignoreCase);
public static bool IsWellKnownOrdinalComparer (System.Collections.Generic.IEqualityComparer<string?>? comparer, out bool ignoreCase);
static member IsWellKnownOrdinalComparer : System.Collections.Generic.IEqualityComparer<string> * bool -> bool
Public Shared Function IsWellKnownOrdinalComparer (comparer As IEqualityComparer(Of String), ByRef ignoreCase As Boolean) As Boolean
- comparer
- IEqualityComparer<String>
The comparer to query.
- ignoreCase
- Boolean
When this method returns, contains a value stating whether comparer
is case-insensitive. Set to false
if this method returns false
.
true
if comparer
is a well-known ordinal string comparer; otherwise, false
.
A "well-known ordinal comparer" describes a comparer that behaves identically to Ordinal
when passed to Dictionary<TKey,TValue> or HashSet<T>.
For example, Default is a well-known ordinal comparer because
a Dictionary<TKey,TValue> given Default as a constructor
argument will behave identically to a Dictionary<TKey,TValue> given Ordinal
as a constructor argument. If ignoreCase
is true
on method exit,
then comparer
behaves identically to OrdinalIgnoreCase when passed to the
constructor of such a collection.
Product | Versions |
---|---|
.NET | 6, 7, 8, 9 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: