0
0
mirror of https://github.com/python/cpython.git synced 2024-11-28 08:20:55 +01:00

Add optional separator character to capwords(), for completeness.

This commit is contained in:
Guido van Rossum 1996-08-20 20:25:41 +00:00
parent 63f0cf0840
commit 34f173110f
2 changed files with 4 additions and 4 deletions

View File

@ -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

View File

@ -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