Compare string using locale
Compares string values using locale rules
Evaluation
This expression evaluates to a function of the form:
(a, b) -> long
The function is consistent with sort order semantics of the Sort step.
Processing
Arguments a
and b
are compared and one of the following values is returned:
0
ifa
andb
are considered equal-1
ifa
should be sorted beforeb
1
ifa
should be sorted afterb
An error is thrown if either a
or b
is not a string and not nil
Settings
Name | Type | Description |
---|---|---|
Locale |
string | The locale to use. Different locales have different conventions on how to sort accented letters and special characters. |
Collator Strength |
string |
This setting determines locale-specific rules as to which characters to consider distinct. As a general approximation, the following rules apply:
|
Key Cache Size |
long |
Strings can be compared faster using comparison keys. Generating comparison keys incurs a one-time overhead that is compensated as strings are then repeatedly compared, for example during sorting. This setting determines the size of the LRU cache the function uses to store comparison keys. |
Nil Values |
string |
Defines how to sort
|