Created
August 8, 2020 11:34
-
-
Save rasel-rz/2a3db0c0e291e22997ef18e66b675c77 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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