Created
October 2, 2012 23:30
-
-
Save josephmosby/3823984 to your computer and use it in GitHub Desktop.
Recursive Find/Replace
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def apply_converter(match, replacement, test_string): | |
if match in test_string: | |
pos = test_string.find(match) | |
new_string = test_string.replace(match, replacement) | |
return apply_converter(converter, new_string) | |
else: | |
return test_string |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment