Skip to content

Commit 7d3acc4

Browse files
committed
Add an example for str.casefold
WIP to fix python#106318
1 parent 09e72cf commit 7d3acc4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1775,7 +1775,12 @@ expression support in the :mod:`re` module).
17751775
intended to remove all case distinctions in a string. For example, the German
17761776
lowercase letter ``'ß'`` is equivalent to ``"ss"``. Since it is already
17771777
lowercase, :meth:`lower` would do nothing to ``'ß'``; :meth:`casefold`
1778-
converts it to ``"ss"``.
1778+
converts it to ``"ss"``, as follows. For example::
1779+
1780+
>>> 'ß'.casefold()
1781+
'ss'
1782+
>>> 'ß'.lower()
1783+
'ß'
17791784

17801785
The casefolding algorithm is
17811786
`described in section 3.13 'Default Case Folding' of the Unicode Standard

0 commit comments

Comments
 (0)