Skip to content

Commit 2f27098

Browse files
[3.13] pythongh-106318: Add examples for str.istitle() (pythonGH-140046) (python#140114)
Co-authored-by: Adorilson Bezerra <[email protected]>
1 parent bc3f288 commit 2f27098

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
@@ -2021,6 +2021,19 @@ expression support in the :mod:`re` module).
20212021
character, for example uppercase characters may only follow uncased characters
20222022
and lowercase characters only cased ones. Return ``False`` otherwise.
20232023

2024+
For example:
2025+
2026+
.. doctest::
2027+
2028+
>>> 'Spam, Spam, Spam'.istitle()
2029+
True
2030+
>>> 'spam, spam, spam'.istitle()
2031+
False
2032+
>>> 'SPAM, SPAM, SPAM'.istitle()
2033+
False
2034+
2035+
See also :meth:`title`.
2036+
20242037

20252038
.. method:: str.isupper()
20262039

@@ -2398,6 +2411,8 @@ expression support in the :mod:`re` module).
23982411
>>> titlecase("they're bill's friends.")
23992412
"They're Bill's Friends."
24002413

2414+
See also :meth:`istitle`.
2415+
24012416

24022417
.. method:: str.translate(table, /)
24032418

0 commit comments

Comments
 (0)