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:
parent
63f0cf0840
commit
34f173110f
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user