CompareInfo.GetSortKey 方法

定义

获取字符串的 SortKey 对象。Gets a SortKey object for a string.

重载

GetSortKey(String)

获取指定字符串的排序关键字。Gets the sort key for the specified string.

GetSortKey(String, CompareOptions)

使用指定的 SortKey 值获取指定字符串的 CompareOptions 对象。Gets a SortKey object for the specified string using the specified CompareOptions value.

GetSortKey(String)

获取指定字符串的排序关键字。Gets the sort key for the specified string.

public:
 virtual System::Globalization::SortKey ^ GetSortKey(System::String ^ source);
public virtual System.Globalization.SortKey GetSortKey (string source);
abstract member GetSortKey : string -> System.Globalization.SortKey
override this.GetSortKey : string -> System.Globalization.SortKey
Public Overridable Function GetSortKey (source As String) As SortKey

参数

source
String

获取其 SortKey 对象的字符串。The string for which a SortKey object is obtained.

返回

包含指定字符串的排序关键字的 SortKey 对象。The SortKey object that contains the sort key for the specified string.

注解

字符串中的每个字符都被给定多个排序权重类别,包括脚本、字母、大小写和音调符号权重。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. GetSortKey 方法等效于带有 LCMAP_SORTKEY 标志的 Windows API 方法 LCMapStringThe GetSortKey method is equivalent to the Windows API method LCMapString with the LCMAP_SORTKEY flag.

另请参阅

GetSortKey(String, CompareOptions)

使用指定的 SortKey 值获取指定字符串的 CompareOptions 对象。Gets a SortKey object for the specified string using the specified CompareOptions value.

public:
 virtual System::Globalization::SortKey ^ GetSortKey(System::String ^ source, System::Globalization::CompareOptions options);
public virtual System.Globalization.SortKey GetSortKey (string source, System.Globalization.CompareOptions options);
abstract member GetSortKey : string * System.Globalization.CompareOptions -> System.Globalization.SortKey
override this.GetSortKey : string * System.Globalization.CompareOptions -> System.Globalization.SortKey
Public Overridable Function GetSortKey (source As String, options As CompareOptions) As SortKey

参数

source
String

获取其 SortKey 对象的字符串。The string for which a SortKey object is obtained.

options
CompareOptions

以下一个或多个定义该排序关键字如何计算的枚举值的按位组合: IgnoreCaseIgnoreSymbolsIgnoreNonSpaceIgnoreWidthIgnoreKanaTypeStringSortA bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: IgnoreCase, IgnoreSymbols, IgnoreNonSpace, IgnoreWidth, IgnoreKanaType, and StringSort.

返回

包含指定字符串的排序关键字的 SortKey 对象。The SortKey object that contains the sort key for the specified string.

异常

options 包含无效的 CompareOptions 值。options contains an invalid CompareOptions value.

注解

字符串中的每个字符都被给定多个排序权重类别,包括脚本、字母、大小写和音调符号权重。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. GetSortKey 方法等效于带有 LCMAP_SORTKEY 标志的 Windows API 方法 LCMapStringThe GetSortKey method is equivalent to the Windows API method LCMapString with the LCMAP_SORTKEY flag.

另请参阅

适用于