diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 12:33:22 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 12:33:22 (GMT) |
commit | a40bdda9377dfaa9a39a4019cecbe16e3ca9f884 (patch) | |
tree | df5947b2a54fefb0a6f5ee82c1ff824651091e86 /Doc | |
parent | 2c6a949e43f55ddd0a09e1eba611f03a47268913 (diff) | |
download | cpython-a40bdda9377dfaa9a39a4019cecbe16e3ca9f884.zip cpython-a40bdda9377dfaa9a39a4019cecbe16e3ca9f884.tar.gz cpython-a40bdda9377dfaa9a39a4019cecbe16e3ca9f884.tar.bz2 |
Merged revisions 75070 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r75070 | ezio.melotti | 2009-09-26 14:20:53 +0300 (Sat, 26 Sep 2009) | 1 line
#7000: document "sep" in capwords. Add a few tests
........
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/string.rst | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/Doc/library/string.rst b/Doc/library/string.rst index 3466af6..cc05a7d 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -565,10 +565,12 @@ rule: Helper functions ---------------- -.. function:: capwords(s) - - Split the argument into words using :func:`split`, capitalize each word using - :func:`capitalize`, and join the capitalized words using :func:`join`. Note - that this replaces runs of whitespace characters by a single space, and removes - leading and trailing whitespace. +.. function:: capwords(s[, sep]) + + Split the argument into words using :meth:`str.split`, capitalize each word + using :meth:`str.capitalize`, and join the capitalized words using + :meth:`str.join`. If the optional second argument *sep* is absent + or ``None``, runs of whitespace characters are replaced by a single space + and leading and trailing whitespace are removed, otherwise *sep* is used to + split and join the words. |