Python string replace 方法

Python string replace   方法

方法1:

>>> a='...fuck...the....world............'
>>> b=a.replace('.',' ')
>>> print b
   fuck   the    world

方法2:

>>> a='...fuck...the....world............'
>>> b=string.replace(a,'.',' ')
>>> print b
   fuck   the    world 

事在人为,功不唐捐
原文地址:https://www.cnblogs.com/xinleishare/p/4256673.html