From: Adorilson Bezerra Date: Tue, 14 Oct 2025 14:19:27 +0000 (-0300) Subject: gh-106318: Add examples for str.istitle() (#140046) X-Git-Tag: v3.15.0a2~448^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07e617ecc274f21607320e68a7e8b09ee91f968b;p=thirdparty%2FPython%2Fcpython.git gh-106318: Add examples for str.istitle() (#140046) --- diff --git a/Doc/library/stdtypes.rst b/Doc/library/stdtypes.rst index 21fe35edc1be..2c5b721093d5 100644 --- a/Doc/library/stdtypes.rst +++ b/Doc/library/stdtypes.rst @@ -2157,6 +2157,19 @@ expression support in the :mod:`re` module). character, for example uppercase characters may only follow uncased characters and lowercase characters only cased ones. Return ``False`` otherwise. + For example: + + .. doctest:: + + >>> 'Spam, Spam, Spam'.istitle() + True + >>> 'spam, spam, spam'.istitle() + False + >>> 'SPAM, SPAM, SPAM'.istitle() + False + + See also :meth:`title`. + .. method:: str.isupper() @@ -2534,6 +2547,8 @@ expression support in the :mod:`re` module). >>> titlecase("they're bill's friends.") "They're Bill's Friends." + See also :meth:`istitle`. + .. method:: str.translate(table, /)