[Tutor] String replace question

Rod python at mhockey.us
Wed Jul 28 14:41:49 CEST 2010


Hello,

I need to replace a period (.) in a domain name with a slash period (\.).

I'm attempting to use the string replace method to do this.

Example:

uri = domain.com

uri.replace('.', '\.')

This returns 'domain\\.com'

Is there a way to do this so there is not a double slash before the period?

Thanks for any help,
Rod


More information about the Tutor mailing list