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 ee2775c commit d11e9ffCopy full SHA for d11e9ff
Doc/library/stdtypes.rst
@@ -2775,8 +2775,22 @@ expression support in the :mod:`re` module).
2775
.. method:: str.swapcase()
2776
2777
Return a copy of the string with uppercase characters converted to lowercase and
2778
- vice versa. Note that it is not necessarily true that
2779
- ``s.swapcase().swapcase() == s``.
+ vice versa. For example:
+
2780
+ .. doctest::
2781
2782
+ >>> 'Hello World'.swapcase()
2783
+ 'hELLO wORLD'
2784
2785
+ Note that it is not necessarily true that ``s.swapcase().swapcase() == s``.
2786
+ For example:
2787
2788
2789
2790
+ >>> 'straße'.swapcase().swapcase()
2791
+ 'strasse'
2792
2793
+ See also :meth:`str.lower` and :meth:`str.upper`.
2794
2795
2796
.. method:: str.title()
0 commit comments