Correctly capitalize after opening bracket
This commit is contained in:
parent
4e16f14ffc
commit
8074cf06b7
|
@ -34,7 +34,13 @@ def changeCase(txt, case_type):
|
||||||
if case_type == "upper":
|
if case_type == "upper":
|
||||||
return txt.upper()
|
return txt.upper()
|
||||||
if case_type == "start":
|
if case_type == "start":
|
||||||
return string.capwords(txt)
|
txt = txt.split(" ")
|
||||||
|
for i, word in enumerate(txt):
|
||||||
|
if word[0] in ['(', '{', '[']:
|
||||||
|
txt[i] = word[0] + word[1:].capitalize()
|
||||||
|
else:
|
||||||
|
txt[i] = word.capitalize()
|
||||||
|
return " ".join(txt)
|
||||||
if case_type == "sentence":
|
if case_type == "sentence":
|
||||||
return txt.capitalize()
|
return txt.capitalize()
|
||||||
return str
|
return str
|
||||||
|
|
Loading…
Reference in New Issue