xinleishare

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 

 

分类:

技术点:

相关文章: