Python中的字符串替换函数

输出结果 

 (由于部分字符超出了打印字符的范围

另外注意,这里的intab和outtab必须等长,因为它们的替换次序是一一对应的

replace的效果

str = "this is string"
print str.replace("is","99")
th99 99 string


猜你喜欢

转载自blog.csdn.net/weixin_42280517/article/details/80443404