Skip to content

Commit a9db299

Browse files
[3.14] gh-106318: Add example for str.expandtabs() (GH-134525) (#135476)
Co-authored-by: Blaise Pabon <[email protected]>
1 parent 46e7ed7 commit a9db299

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Doc/library/stdtypes.rst

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,12 +1891,15 @@ expression support in the :mod:`re` module).
18911891
(``\n``) or return (``\r``), it is copied and the current column is reset to
18921892
zero. Any other character is copied unchanged and the current column is
18931893
incremented by one regardless of how the character is represented when
1894-
printed.
1894+
printed. For example::
18951895

18961896
>>> '01\t012\t0123\t01234'.expandtabs()
18971897
'01 012 0123 01234'
18981898
>>> '01\t012\t0123\t01234'.expandtabs(4)
18991899
'01 012 0123 01234'
1900+
>>> print('01\t012\n0123\t01234'.expandtabs(4))
1901+
01 012
1902+
0123 01234
19001903

19011904

19021905
.. method:: str.find(sub[, start[, end]])

0 commit comments

Comments
 (0)