Anjanesh Lekshminarayanan wrote:
import re
new_str = re.sub('[aeiou]', '-', str)
Wow - this is neat. Thanks

But probably slower and definitely harder to understand. For simple problems the str methods are usually faster than a regular expression.

Christian

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to