Last active
September 2, 2022 17:44
-
-
Save fastfingertips/0becf4b067f01996c3500c9c94dcd855 to your computer and use it in GitHub Desktop.
This file contains 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 uncamel(text): | |
"""helloWorld => hello_world""" | |
r = '' | |
for t in text: | |
r += '_' + t.lower() if t.isupper() else t | |
return r | |
print(uncamel('helloWorld')) | |
print(uncamel('goodbyeWorld')) | |
print(uncamel('loremIpsum')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment