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 6665115 commit bc52457Copy full SHA for bc52457
Doc/library/stdtypes.rst
@@ -2792,8 +2792,22 @@ expression support in the :mod:`re` module).
2792
.. method:: str.swapcase()
2793
2794
Return a copy of the string with uppercase characters converted to lowercase and
2795
- vice versa. Note that it is not necessarily true that
2796
- ``s.swapcase().swapcase() == s``.
+ vice versa. For example:
+
2797
+ .. doctest::
2798
2799
+ >>> 'Hello World'.swapcase()
2800
+ 'hELLO wORLD'
2801
2802
+ Note that it is not necessarily true that ``s.swapcase().swapcase() == s``.
2803
+ For example:
2804
2805
2806
2807
+ >>> 'straße'.swapcase().swapcase()
2808
+ 'strasse'
2809
2810
+ See also :meth:`str.lower` and :meth:`str.upper`.
2811
2812
2813
.. method:: str.title()
0 commit comments