想替换string里的空格,遍历替换提示如题错误,查询得知string类型不可更改
1 import string 2 s = "2013/2/12" 3 b = s.replace('/','_') 4 5 print b