StringComparer.IsWellKnownOrdinalComparer Method
Definition
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
Parameters
- 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
.
Returns
true
if comparer
is a well-known ordinal string comparer; otherwise, false
.
Remarks
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.
Applies to
คำติชม
https://aka.ms/ContentUserFeedback
เร็วๆ นี้: ตลอดปี 2024 เราจะขจัดปัญหา GitHub เพื่อเป็นกลไกคำติชมสำหรับเนื้อหา และแทนที่ด้วยระบบคำติชมใหม่ สำหรับข้อมูลเพิ่มเติม ให้ดู:ส่งและดูข้อคิดเห็นสำหรับ