mirror of
https://github.com/python/cpython.git
synced 2026-02-20 14:21:22 +00:00
Merge issue #16439: Fix markup in example for stdtypes.
Thanks to Yongzhi Pan.
This commit is contained in:
commit
7cac2d8368
1 changed files with 5 additions and 5 deletions
|
|
@ -1832,11 +1832,11 @@ expression support in the :mod:`re` module).
|
|||
|
||||
>>> import re
|
||||
>>> def titlecase(s):
|
||||
return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
|
||||
lambda mo: mo.group(0)[0].upper() +
|
||||
mo.group(0)[1:].lower(),
|
||||
s)
|
||||
|
||||
... return re.sub(r"[A-Za-z]+('[A-Za-z]+)?",
|
||||
... lambda mo: mo.group(0)[0].upper() +
|
||||
... mo.group(0)[1:].lower(),
|
||||
... s)
|
||||
...
|
||||
>>> titlecase("they're bill's friends.")
|
||||
"They're Bill's Friends."
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue