Text.equals_ignore_case
equals_ignore_casethat locale
Group: Logical
Documentation
Checks whether self
is equal to that
, ignoring the case of the texts.
Two texts are considered equal ignoring case if they are of the same length and corresponding characters are equal ignoring case.
Arguments
that
: The text to compareself
for case-insensitive equality with.locale
: The locale to use for case-insensitive comparison.
Examples
The string 'É' (i.e. U+00C9, LATIN CAPITAL LETTER E WITH ACUTE) is
equal to the string 'é' (i.e. U+00E9, LATIN SMALL LETTER E WITH ACUTE)
ignoring case, which is canonically the same as the string 'e\u0301'
(i.e. the letter e
followed by U+0301, COMBINING ACUTE ACCENT).
Therefore:
(('É' . equals_ignore_case 'é') && ('é' . equals_ignore_case 'e\u0301')) == True
Remarks
Unicode Equality
The definition of equality includes Unicode canonicalization. I.e. two texts are equal if they are identical after canonical decomposition. This ensures that different ways of expressing the same character in the underlying binary representation are considered equal.