mirror of
https://github.com/python/cpython.git
synced 2026-02-13 18:49:46 +00:00
[3.14] gh-106318: Add examples for str.istitle() (GH-140046) (#140113)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
This commit is contained in:
parent
525f7c23b9
commit
6a467d3eda
1 changed files with 15 additions and 0 deletions
|
|
@ -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, /)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue