fixed changeCase for strings with trailing whitespace

This commit is contained in:
RemixDev 2022-01-02 14:14:57 +01:00
parent 1863557f49
commit 27219d0698
1 changed files with 2 additions and 2 deletions

View File

@ -35,9 +35,9 @@ def changeCase(txt, case_type):
if case_type == "upper":
return txt.upper()
if case_type == "start":
txt = txt.split(" ")
txt = txt.strip().split(" ")
for i, word in enumerate(txt):
if word[0] in ['(', '{', '[']:
if word[0] in ['(', '{', '[', "'", '"']:
txt[i] = word[0] + word[1:].capitalize()
else:
txt[i] = word.capitalize()