[3.13] gh-106318: Add example for str.expandtabs() (GH-134525) (#135477)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
This commit is contained in:
Miss Islington (bot) 2025-06-13 17:50:53 +02:00 committed by GitHub
parent 0430135aac
commit 6b9672c2bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1755,12 +1755,15 @@ expression support in the :mod:`re` module).
(``\n``) or return (``\r``), it is copied and the current column is reset to
zero. Any other character is copied unchanged and the current column is
incremented by one regardless of how the character is represented when
printed.
printed. For example::
>>> '01\t012\t0123\t01234'.expandtabs()
'01 012 0123 01234'
>>> '01\t012\t0123\t01234'.expandtabs(4)
'01 012 0123 01234'
>>> print('01\t012\n0123\t01234'.expandtabs(4))
01 012
0123 01234
.. method:: str.find(sub[, start[, end]])