Created
July 8, 2014 02:46
-
-
Save azami/10e97886c925c8a9bdcf to your computer and use it in GitHub Desktop.
python camel case to snake case
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 to_snake_case(string): | |
return re.sub('(.)([A-Z]{1})', r'\1_\2', string).lower() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment