Split camel case string word by word
import re str = 'getSampleTextFromDB' [x for x in re.split('([a-z]+)([A-Z][a-z]+)|([A-Z][a-z]+)', str) if x != None and x != '']
Execution result
['get', 'Sample', 'Text', 'From', 'DB']
Recommended Posts