how can i change string using for-loop without regex.
example : (python 2.7.1)
import re
trans = lambda src: re.sub("([A-Z])", lambda m:"_"+m.group().lower(), src, flags=0)
print(trans("helloWorld"))
i expect to result as :
hello_world
i want to change from regex version into for-loop version.
conditions
- the result will be the same
- just one line!
- using for loop