Skip to content

Commit 07e617e

Browse files
authored
gh-106318: Add examples for str.istitle() (#140046)
1 parent 87eadce commit 07e617e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,6 +2157,19 @@ expression support in the :mod:`re` module).
21572157
character, for example uppercase characters may only follow uncased characters
21582158
and lowercase characters only cased ones. Return ``False`` otherwise.
21592159

2160+
For example:
2161+
2162+
.. doctest::
2163+
2164+
>>> 'Spam, Spam, Spam'.istitle()
2165+
True
2166+
>>> 'spam, spam, spam'.istitle()
2167+
False
2168+
>>> 'SPAM, SPAM, SPAM'.istitle()
2169+
False
2170+
2171+
See also :meth:`title`.
2172+
21602173

21612174
.. method:: str.isupper()
21622175

@@ -2534,6 +2547,8 @@ expression support in the :mod:`re` module).
25342547
>>> titlecase("they're bill's friends.")
25352548
"They're Bill's Friends."
25362549

2550+
See also :meth:`istitle`.
2551+
25372552

25382553
.. method:: str.translate(table, /)
25392554

0 commit comments

Comments
 (0)