| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2771,8 +2771,22 @@ expression support in the :mod:`re` module). | |||
| 2771 | 2771 | .. method:: str.swapcase() | |
| 2772 | 2772 | ||
| 2773 | 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``. | ||
| 2774 | + vice versa. For example: | ||
| 2775 | + | ||
| 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 | + .. doctest:: | ||
| 2785 | + | ||
| 2786 | + >>> 'straße'.swapcase().swapcase() | ||
| 2787 | + 'strasse' | ||
| 2788 | + | ||
| 2789 | + See also :meth:`str.lower` and :meth:`str.upper`. | ||
| 2776 | 2790 | ||
| 2777 | 2791 | ||
| 2778 | 2792 | .. method:: str.title() | |
| Back | FazBrowse Home | New Git URL |
0 commit comments