I'm trying to reformat a series of strings into Camel Case by returning the fragments from input as a single "sentence".
this is what I have so far -
def convert(s):
if(len(s) == 0):
return
s1 = ''
s1 += s[0].upper()
for i in range(1, len(s)):
if (s[i] == ' '):
s1 += s[i + 1].upper()
i += 1
elif(s[i - 1] != ' '):
s1 += s[i]
print(s1)
# Driver Code
def main():
s = "BusOneBusTWOBUSthree"
convert(s)
if __name__=="__main__":
main()
output I'm getting is - Bus One Bus TWO BUS three
output I'm wanting to get is -
busOne busTwo busThree