summaryrefslogtreecommitdiffstats
path: root/Lib/string.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>1996-08-20 20:25:41 (GMT)
committerGuido van Rossum <guido@python.org>1996-08-20 20:25:41 (GMT)
commit34f173110fbe9f765c43f38b5a5731b5539eb295 (patch)
tree30f19618c3dd2bc89c3e881e67b40dfd6841ae33 /Lib/string.py
parent63f0cf084077bdfe165a899175deca24a0f783e5 (diff)
downloadcpython-34f173110fbe9f765c43f38b5a5731b5539eb295.zip
cpython-34f173110fbe9f765c43f38b5a5731b5539eb295.tar.gz
cpython-34f173110fbe9f765c43f38b5a5731b5539eb295.tar.bz2
Add optional separator character to capwords(), for completeness.
Diffstat (limited to 'Lib/string.py')
-rw-r--r--Lib/string.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/string.py b/Lib/string.py
index 1953bfc..fd8363b 100644
--- a/Lib/string.py
+++ b/Lib/string.py
@@ -287,8 +287,8 @@ def capitalize(s):
# Capitalize the words in a string, e.g. " aBc dEf " -> "Abc Def".
# See also regsub.capwords().
-def capwords(s):
- return join(map(capitalize, split(s)))
+def capwords(s, sep=None):
+ return join(map(capitalize, split(s, sep)))
# Construct a translation string
_idmapL = None