From 34f173110fbe9f765c43f38b5a5731b5539eb295 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 20 Aug 1996 20:25:41 +0000 Subject: Add optional separator character to capwords(), for completeness. --- Lib/string.py | 4 ++-- Lib/stringold.py | 4 ++-- 2 files changed, 4 insertions(+), 4 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 diff --git a/Lib/stringold.py b/Lib/stringold.py index 1953bfc..fd8363b 100644 --- a/Lib/stringold.py +++ b/Lib/stringold.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 -- cgit v0.12