System.Globalization.CompareInfo.GetSortKey Method

Gets a System.Globalization.SortKey object for the specified string using the specified System.Globalization.CompareOptions value.

Syntax

public virtual SortKey GetSortKey (string source, CompareOptions options)

Parameters

source
The string for which a System.Globalization.SortKey object is obtained.
options
A bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: CompareOptions.IgnoreCase, CompareOptions.IgnoreSymbols, CompareOptions.IgnoreNonSpace, CompareOptions.IgnoreWidth, CompareOptions.IgnoreKanaType, and CompareOptions.StringSort.

Returns

The System.Globalization.SortKey object that contains the sort key for the specified string.

Remarks

Each character in a string is given several categories of sort weights, including script, alphabetic, case, and diacritic weights. A sort key is the repository of these weights for a particular string. For example, a sort key might contain a string of alphabetic weights, followed by a string of case weights, and so on. The erload:System.Globalization.CompareInfo.GetSortKey method is equivalent to the Windows API method LCMapString with the LCMAP_SORTKEY flag.

Requirements

Namespace: System.Globalization
Assembly: mscorlib (in mscorlib.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0, 4.0.0.0