diff options
author | Georg Brandl <georg@python.org> | 2009-06-08 16:03:41 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2009-06-08 16:03:41 (GMT) |
commit | 2cc39ad242588c2f64c0457b9d243c9cb8462f51 (patch) | |
tree | 9d8c3a516bc4f097ea2844bf756e9e395a3a7b20 /Doc | |
parent | e590d57d063399deafd4f8ae7da1c8251fb398a6 (diff) | |
download | cpython-2cc39ad242588c2f64c0457b9d243c9cb8462f51.zip cpython-2cc39ad242588c2f64c0457b9d243c9cb8462f51.tar.gz cpython-2cc39ad242588c2f64c0457b9d243c9cb8462f51.tar.bz2 |
#6238: add fillchar to string.just function family.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/string.rst | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 168d1a5..3231d13 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -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. -.. function:: ljust(s, width) - rjust(s, width) - center(s, width) +.. function:: ljust(s, width[, fillchar]) + rjust(s, width[, fillchar]) + center(s, width[, fillchar]) 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* - characters wide, created by padding the string *s* with spaces until the given - width on the right, left or both sides. The string is never truncated. + characters wide, created by padding the string *s* with the character *fillchar* + (default is a space) until the given width on the right, left or both sides. + The string is never truncated. .. function:: zfill(s, width) |