---python 2.7
字符串替换函数一般用repalce
1.实例:str ='aaa--bbb'
要替换其中的---
new_str = str.replace('--','')
2.
实例:str1= "aaa/Gbb"
要替换其中的/(斜杠)
pyhon中正斜杠为/,反斜杠为\
说明:使用转义符号(\)
3.实例:str1= "aaa\Gbb"
要替换其中的\(斜杠)
---python 2.7
字符串替换函数一般用repalce
1.实例:str ='aaa--bbb'
要替换其中的---
new_str = str.replace('--','')
2.
实例:str1= "aaa/Gbb"
要替换其中的/(斜杠)
pyhon中正斜杠为/,反斜杠为\
说明:使用转义符号(\)
3.实例:str1= "aaa\Gbb"
要替换其中的\(斜杠)