Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
I love regex!! solution in Clear category for Conversion from CamelCase by new_hoschi
import re
def from_camel_case(name):
''' find every sequence of [uppercase letter + anything different]
(i.e. split the string at the uppercase letters), turn them into lowercase
and join the different sequences with an underscore inbetween... TADAAA!!'''
return '_'.join(j.lower() for j in re.findall(r'([A-Z][^A-Z]*)',name))
April 15, 2020
Comments: