cnq 发表于 2015-12-2 15:26:35

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
  
页: [1]
查看完整版本: Python string replace 方法