Skip to content

Commit b786d9e

Browse files
doc: Link to string.capwords from str.title (GH-20913)
Since `title()` mentions its own short-comings, it should also mention the library function which does not possess them. Co-authored-by: Jelle Zijlstra <[email protected]>
1 parent 1da9c38 commit b786d9e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2189,7 +2189,11 @@ expression support in the :mod:`re` module).
21892189
>>> "they're bill's friends from the UK".title()
21902190
"They'Re Bill'S Friends From The Uk"
21912191

2192-
A workaround for apostrophes can be constructed using regular expressions::
2192+
The :func:`string.capwords` function does not have this problem, as it
2193+
splits words on spaces only.
2194+
2195+
Alternatively, a workaround for apostrophes can be constructed using regular
2196+
expressions::
21932197

21942198
>>> import re
21952199
>>> def titlecase(s):

0 commit comments

Comments
 (0)