Link to `string.capwords` from `str.title`
Since `title()` mentions its own short-comings, it should also mention the library function which does not possess them.
This commit is contained in:
parent
e0bec69854
commit
7429b0abe4
|
@ -2135,8 +2135,12 @@ expression support in the :mod:`re` module).
|
|||
|
||||
>>> "they're bill's friends from the UK".title()
|
||||
"They'Re Bill'S Friends From The Uk"
|
||||
|
||||
The :func:`string.capwords` function does not have this problem, as it
|
||||
splits words on spaces first.
|
||||
|
||||
A workaround for apostrophes can be constructed using regular expressions::
|
||||
Alternatively, a workaround for apostrophes can be constructed using regular
|
||||
expressions::
|
||||
|
||||
>>> import re
|
||||
>>> def titlecase(s):
|
||||
|
|
Loading…
Reference in New Issue