mirror of
https://github.com/python/cpython.git
synced 2026-07-03 08:15:46 -04:00
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:
committed by
GitHub
parent
dab9fb3dc2
commit
ec2619c080
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user