Skip to content

Commit f48c619

Browse files
committed
[Doc] Added snippet code to str.ljust method
1 parent 3596dba commit f48c619

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Doc/library/stdtypes.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,14 @@ expression support in the :mod:`re` module).
22612261
done using the specified *fillchar* (default is an ASCII space). The
22622262
original string is returned if *width* is less than or equal to ``len(s)``.
22632263

2264+
For example::
2265+
2266+
>>> 'Python'.ljust(10)
2267+
'Python '
2268+
>>> 'Python'.ljust(10, '.')
2269+
'Python....'
2270+
2271+
See also :meth:`rjust`.
22642272

22652273
.. method:: str.lower()
22662274

0 commit comments

Comments
 (0)