gh-106318: Add examples for str.ljust() method (#142719)

Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
Adorilson Bezerra 2025-12-16 11:39:20 +00:00 committed by GitHub
parent dab9fb3dc2
commit ec2619c080
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2261,6 +2261,19 @@ expression support in the :mod:`re` module).
done using the specified *fillchar* (default is an ASCII space). The
original string is returned if *width* is less than or equal to ``len(s)``.
For example:
.. doctest::
>>> 'Python'.ljust(10)
'Python '
>>> 'Python'.ljust(10, '.')
'Python....'
>>> 'Monty Python'.ljust(10, '.')
'Monty Python'
See also :meth:`rjust`.
.. method:: str.lower()