Cldr.Collation.compare
You're seeing just the function
compare
, go back to Cldr.Collation module for more information.
Specs
compare(string_1 :: String.t(), string_2 :: String.t(), options()) :: comparison()
Compares two strings according to the Unicode collation rules with the CLDR root collation which is based upon the Unicode DUCET table.
Arguments
string_1
is an at:String.t()
string_2
is an at:String.t()
options
is a keyword list of options
Options
casing
is either:sensitive
or:insensitive
indicating if collation is to be case sensitive or not. The default is:insensitive
Returns
- Either of
:lt
,:eq
or:gt
signifying ifstring_1
is less than, equal to or greater thanstring_2
Examples
iex> Cldr.Collation.compare "á", "A", casing: :sensitive
:gt
iex> Cldr.Collation.compare "á", "A", casing: :insensitive
:eq