Bewerken

Share via


StringComparer.IsWellKnownCultureAwareComparer Method

Definition

Determines whether the specified IEqualityComparer<T> is a well-known culture-aware string comparer.

public:
 static bool IsWellKnownCultureAwareComparer(System::Collections::Generic::IEqualityComparer<System::String ^> ^ comparer, [Runtime::InteropServices::Out] System::Globalization::CompareInfo ^ % compareInfo, [Runtime::InteropServices::Out] System::Globalization::CompareOptions % compareOptions);
public static bool IsWellKnownCultureAwareComparer (System.Collections.Generic.IEqualityComparer<string?>? comparer, out System.Globalization.CompareInfo? compareInfo, out System.Globalization.CompareOptions compareOptions);
static member IsWellKnownCultureAwareComparer : System.Collections.Generic.IEqualityComparer<string> * CompareInfo * CompareOptions -> bool
Public Shared Function IsWellKnownCultureAwareComparer (comparer As IEqualityComparer(Of String), ByRef compareInfo As CompareInfo, ByRef compareOptions As CompareOptions) As Boolean

Parameters

comparer
IEqualityComparer<String>

The comparer to query.

compareInfo
CompareInfo

When this method returns, contains a value indicating which CompareInfo was used to create comparer. Set to null if this method returns false.

compareOptions
CompareOptions

When this method returns, contains a value indicating which CompareOptions was used to create comparer. Set to None if this method returns false.

Returns

true if comparer is a well-known culture-aware string comparer; otherwise, false.

Remarks

A "well-known culture-aware comparer" describes a comparer that's tied to a specific CompareInfo using some defined CompareOptions. To create a StringComparer instance wrapped around a CompareInfo and CompareOptions, use GetStringComparer(CompareInfo, CompareOptions). This method returns false when given Ordinal and other non-linguistic comparers as input.

Applies to