Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitec2619c

Browse files
gh-106318: Add examples for str.ljust() method (#142719)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
1 parentdab9fb3 commitec2619c

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

‎Doc/library/stdtypes.rst‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2261,6 +2261,19 @@ 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+
..doctest::
2267+
2268+
>>>'Python'.ljust(10)
2269+
'Python '
2270+
>>>'Python'.ljust(10,'.')
2271+
'Python....'
2272+
>>>'Monty Python'.ljust(10,'.')
2273+
'Monty Python'
2274+
2275+
See also:meth:`rjust`.
2276+
22642277

22652278
..method::str.lower()
22662279

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp