mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
#6238: add fillchar to string.just function family.
This commit is contained in:
parent
e590d57d06
commit
2cc39ad242
1 changed files with 6 additions and 5 deletions
|
@ -829,14 +829,15 @@ not be removed until Python 3.0. The functions defined in this module are:
|
||||||
Return a copy of *s*, but with lower case letters converted to upper case.
|
Return a copy of *s*, but with lower case letters converted to upper case.
|
||||||
|
|
||||||
|
|
||||||
.. function:: ljust(s, width)
|
.. function:: ljust(s, width[, fillchar])
|
||||||
rjust(s, width)
|
rjust(s, width[, fillchar])
|
||||||
center(s, width)
|
center(s, width[, fillchar])
|
||||||
|
|
||||||
These functions respectively left-justify, right-justify and center a string in
|
These functions respectively left-justify, right-justify and center a string in
|
||||||
a field of given width. They return a string that is at least *width*
|
a field of given width. They return a string that is at least *width*
|
||||||
characters wide, created by padding the string *s* with spaces until the given
|
characters wide, created by padding the string *s* with the character *fillchar*
|
||||||
width on the right, left or both sides. The string is never truncated.
|
(default is a space) until the given width on the right, left or both sides.
|
||||||
|
The string is never truncated.
|
||||||
|
|
||||||
|
|
||||||
.. function:: zfill(s, width)
|
.. function:: zfill(s, width)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue