下划线转驼峰
1 | res = re.sub(r'_[a-z]', lambda x: x.group(0)[1].upper(), 'SUBMIT_LEAD_FORM'.lower().capitalize()) |
All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.
1 | res = re.sub(r'_[a-z]', lambda x: x.group(0)[1].upper(), 'SUBMIT_LEAD_FORM'.lower().capitalize()) |