mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +00:00
[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:
parent
968d51b414
commit
e0a77821d6
1 changed files with 13 additions and 0 deletions
|
|
@ -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()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue