Skip to content

Instantly share code, notes, and snippets.

@rasel-rz
Created August 8, 2020 11:34
Show Gist options
  • Save rasel-rz/2a3db0c0e291e22997ef18e66b675c77 to your computer and use it in GitHub Desktop.
Save rasel-rz/2a3db0c0e291e22997ef18e66b675c77 to your computer and use it in GitHub Desktop.
def camelCase(text):
textLength = len(text)
outText = ''
nextOneIsCapital = False
for i in range(textLength):
if i is 0:
outText = outText + text[i].lower()
else:
if text[i] is not ' ':
if nextOneIsCapital:
outText = outText + text[i].upper()
nextOneIsCapital = False
else:
outText = outText + text[i]
else:
nextOneIsCapital = True
return outText
print(camelCase('One two Three Five nine 99 nine'))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment