Fixed start of each word and sentence case capitalization
This commit is contained in:
parent
9e67e8e93b
commit
df79e3009f
|
@ -29,11 +29,11 @@ def changeCase(string, type):
|
||||||
string = string.split(" ")
|
string = string.split(" ")
|
||||||
res = []
|
res = []
|
||||||
for index, value in enumerate(string):
|
for index, value in enumerate(string):
|
||||||
res.append(value[0].upper() + value[0:].lower())
|
res.append(value[0].upper() + value[1:].lower())
|
||||||
res = " ".join(res)
|
res = " ".join(res)
|
||||||
return res
|
return res
|
||||||
elif type == "sentence":
|
elif type == "sentence":
|
||||||
res = string[0].upper() + string[0:].lower()
|
res = string[0].upper() + string[1:].lower()
|
||||||
return res
|
return res
|
||||||
else:
|
else:
|
||||||
return string
|
return string
|
||||||
|
|
Loading…
Reference in New Issue