[3.14] gh-106318: Add examples for str.ljust() method (GH-142719) (#142802)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This commit is contained in:
Miss Islington (bot) 2025-12-16 12:45:13 +01:00 committed by GitHub
parent 968d51b414
commit e0a77821d6
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()