File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed
Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change @@ -2801,19 +2801,15 @@ expression support in the :mod:`re` module).
28012801 Return a titlecased version of the string where words start with an uppercase
28022802 character and the remaining characters are lowercase.
28032803
2804- For example:
2805-
2806- .. doctest ::
2804+ For example::
28072805
28082806 >>> 'Hello world'.title()
28092807 'Hello World'
28102808
28112809 The algorithm uses a simple language-independent definition of a word as
28122810 groups of consecutive letters. The definition works in many contexts but
28132811 it means that apostrophes in contractions and possessives form word
2814- boundaries, which may not be the desired result:
2815-
2816- .. doctest ::
2812+ boundaries, which may not be the desired result::
28172813
28182814 >>> "they're bill's friends from the UK".title()
28192815 "They'Re Bill'S Friends From The Uk"
@@ -2822,9 +2818,7 @@ expression support in the :mod:`re` module).
28222818 splits words on spaces only.
28232819
28242820 Alternatively, a workaround for apostrophes can be constructed using regular
2825- expressions:
2826-
2827- .. doctest ::
2821+ expressions::
28282822
28292823 >>> import re
28302824 >>> def titlecase(s):
@@ -2835,7 +2829,7 @@ expression support in the :mod:`re` module).
28352829 >>> titlecase("they're bill's friends.")
28362830 "They're Bill's Friends."
28372831
2838- See also :meth: `istitle ` and :meth: ` capitalize ` .
2832+ See also :meth: `istitle `.
28392833
28402834
28412835.. method :: str.translate(table, /)
You can’t perform that action at this time.
0 commit comments