trouble with replace

Marc 'BlackJack' Rintsch bj_666 at gmx.net
Sat Aug 12 13:00:37 EDT 2006


In <1155401390.926925.252000 at m79g2000cwm.googlegroups.com>, f pemberton
wrote:

> I've tried using replace but its not working for me.
> xdata.replace('abcdef', 'highway')
> xdata.replace('defgef', 'news')
> xdata.replace('effwer', 'monitor')

`replace()` does not work in place.  You have to bind the result to a name
like::

  xdata = xdata.replace('abcdef', 'highway')

Ciao,
	Marc 'BlackJack' Rintsch



More information about the Python-list mailing list