CompareInfo.GetSortKeyLength(ReadOnlySpan<Char>, CompareOptions) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the total number of sort key bytes that would be produced from the specified input.
public int GetSortKeyLength (ReadOnlySpan<char> source, System.Globalization.CompareOptions options = System.Globalization.CompareOptions.None);
member this.GetSortKeyLength : ReadOnlySpan<char> * System.Globalization.CompareOptions -> int
Public Function GetSortKeyLength (source As ReadOnlySpan(Of Char), Optional options As CompareOptions = System.Globalization.CompareOptions.None) As Integer
Parameters
- source
- ReadOnlySpan<Char>
The text to get the sort key for.
- options
- CompareOptions
An optional combination of CompareOptions enumeration values to use for computing the sort key. The default value is None.
Returns
The length, in bytes, of the sort key.
Exceptions
options
contains an unsupported flag.
-or-
source
cannot be processed using the desired CompareOptions under the current CompareInfo.