diff options
Diffstat (limited to 'Doc/library/string.rst')
| -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 3466af6504..cc05a7df1c 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. |
