Прочитај на енглеском Уреди

Делите путем


GlobalizationExtensions.GetStringComparer(CompareInfo, CompareOptions) Method

Definition

Returns a StringComparer object based on the culture-sensitive string comparison rules of a specified CompareInfo object.

C#
public static StringComparer GetStringComparer(this System.Globalization.CompareInfo compareInfo, System.Globalization.CompareOptions options);

Parameters

compareInfo
CompareInfo

An object that supports culture-sensitive string comparison.

options
CompareOptions

A value that defines how strings should be compared. options is either the enumeration value Ordinal, the enumeration value OrdinalIgnoreCase, or a bitwise combination of one or more of the following values: IgnoreCase, IgnoreSymbols, IgnoreNonSpace, IgnoreWidth, IgnoreKanaType, and StringSort.

Returns

An object that can be used to perform string comparisons.

Exceptions

compareInfo is null.

options is invalid.

Applies to

Производ Верзије
.NET Core 1.0, Core 1.1, Core 2.0, Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Framework 4.7.1, 4.7.2, 4.8, 4.8.1
.NET Standard 2.0, 2.1
UWP 10.0