Cldr.Collation.compare

You're seeing just the function compare, go back to Cldr.Collation module for more information.
Link to this function

compare(string_1, string_2, options \\ [casing: :insensitive])

View Source

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

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 if string_1 is less than, equal to or greater than string_2.

Examples

iex> Cldr.Collation.compare "á", "A", casing: :sensitive
:gt

iex> Cldr.Collation.compare "á", "A", casing: :insensitive
:eq