We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 88fc1e6 commit 571c337Copy full SHA for 571c337
Doc/library/stdtypes.rst
@@ -2771,8 +2771,22 @@ expression support in the :mod:`re` module).
2771
.. method:: str.swapcase()
2772
2773
Return a copy of the string with uppercase characters converted to lowercase and
2774
- vice versa. Note that it is not necessarily true that
2775
- ``s.swapcase().swapcase() == s``.
+ vice versa. For example:
+
2776
+ .. doctest::
2777
2778
+ >>> 'Hello World'.swapcase()
2779
+ 'hELLO wORLD'
2780
2781
+ Note that it is not necessarily true that ``s.swapcase().swapcase() == s``.
2782
+ For example:
2783
2784
2785
2786
+ >>> 'straße'.swapcase().swapcase()
2787
+ 'strasse'
2788
2789
+ See also :meth:`str.lower` and :meth:`str.upper`.
2790
2791
2792
.. method:: str.title()
0 commit comments