Show pageOld revisionsBacklinksBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. # python split ``` import re def split_class_name(class_name): sub = re.sub('([A-Z][^A-Z]*)', r' \1', class_name) splitted = re.split(r'[\s\-_]', sub) splitted = list(map(lambda x: x.lower().strip(), splitted)) splitted = list(filter(lambda x: x != '', splitted)) return ' '.join(splitted) name = 'amaCamelCase__Test123-dash' result = split_class_name(name) ['ama', 'camel', 'case', 'test123', 'dash'] ``` open/python-split.txt Last modified: 2024/10/05 06:15by 127.0.0.1