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 0438467 commit 8337805Copy full SHA for 8337805
Doc/library/stdtypes.rst
@@ -2620,8 +2620,22 @@ expression support in the :mod:`re` module).
2620
.. method:: str.swapcase()
2621
2622
Return a copy of the string with uppercase characters converted to lowercase and
2623
- vice versa. Note that it is not necessarily true that
2624
- ``s.swapcase().swapcase() == s``.
+ vice versa. For example:
+
2625
+ .. doctest::
2626
2627
+ >>> 'Hello World'.swapcase()
2628
+ 'hELLO wORLD'
2629
2630
+ Note that it is not necessarily true that ``s.swapcase().swapcase() == s``.
2631
+ For example:
2632
2633
2634
2635
+ >>> 'straße'.swapcase().swapcase()
2636
+ 'strasse'
2637
2638
+ See also :meth:`str.lower` and :meth:`str.upper`.
2639
2640
2641
.. method:: str.title()
0 commit comments