英語で読む 編集

次の方法で共有


StringComparer.IsWellKnownCultureAwareComparer Method

Definition

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

C#
public static bool IsWellKnownCultureAwareComparer(System.Collections.Generic.IEqualityComparer<string?>? comparer, out System.Globalization.CompareInfo? compareInfo, out System.Globalization.CompareOptions compareOptions);

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

製品 バージョン
.NET 6, 7, 8, 9, 10