Add escape functionality to string.substitute.