diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 11:23:16 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2009-09-26 11:23:16 (GMT) |
commit | 9ba83c50f40370a3dd50d5acd15856e7001287b4 (patch) | |
tree | bd64739f7191e5b147046f646e81a9d8f2aaa4ed /Doc | |
parent | 02c0943ea3778d2b32dd9c293efc2f3b5f9db032 (diff) | |
download | cpython-9ba83c50f40370a3dd50d5acd15856e7001287b4.zip cpython-9ba83c50f40370a3dd50d5acd15856e7001287b4.tar.gz cpython-9ba83c50f40370a3dd50d5acd15856e7001287b4.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 2ac09ae..444858c 100644 --- a/Doc/library/string.rst +++ b/Doc/library/string.rst @@ -578,12 +578,14 @@ The following functions are available to operate on string and Unicode objects. They are not available as string methods. -.. 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. .. function:: maketrans(from, to) |