Unicode String v0.1.0 Unicode.String View Source

Link to this section Summary

Link to this section Functions

Link to this function

equals_ignoring_case?(string_a, string_b, type \\ :full)

View Source

Compares two strings in a case insensitive manner.

Case folding is applied to the two string arguments which are then compared with the == operator.

Arguments

  • string_a and string_b are two strings to be compared

  • type is the case folding type to be applied. The alternatives are :full, :simple and :turkic. The default is :full.

Returns

  • true or false

Notes

  • This function applies the Unicode Case Folding algorithm

  • The algorithm does not apply any treatment to diacritical marks hence "compare strings without accents" is not part of this function.

Examples

iex> Unicode.String.equals_ignoring_case? "ABC", "abc"
true

iex> Unicode.String.equals_ignoring_case? "beißen", "beissen"
true

iex> Unicode.String.equals_ignoring_case? "grüßen", "grussen"
false

See Unicode.String.Case.Folding.fold/1.

See Unicode.String.Case.Folding.fold/2.