File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -1841,14 +1841,16 @@ expression support in the :mod:`re` module).
18411841 intended to remove all case distinctions in a string. For example, the German
18421842 lowercase letter ``'ß' `` is equivalent to ``"ss" ``. Since it is already
18431843 lowercase, :meth: `lower ` would do nothing to ``'ß' ``; :meth: `casefold `
1844- converts it to ``"ss" ``, as follows:
1844+ converts it to ``"ss" ``. This is useful for case-insensitive string comparisons.
1845+ For example:
18451846
18461847 .. doctest ::
18471848
1848- >>> ' ß' .casefold()
1849- 'ss'
1850- >>> ' ß' .lower()
1851- 'ß'
1849+ >>> ' straße' .lower() == ' strasse'
1850+ False
1851+ >>> ' straße' .casefold() == ' strasse'
1852+ True
1853+
18521854
18531855 The casefolding algorithm is `described in section 3.13.3 'Default Case
18541856 Folding' of the Unicode Standard
You can’t perform that action at this time.
0 commit comments