文章目录
1.str.replace()
str.replace(old, new[, max])
用新字符串 new 替换旧字符串 old,可以设置替换次数 max
old – 将被替换的子字符串。
new – 新字符串,用于替换old子字符串。
max – 可选字符串, 替换不超过 max 次
text1 = ' Info has been found (+/- 100 pages, and 4.5 MB of .pdf files) Now i have to wait untill our team leader has processed it and learns html. '
text1
# str.replace(old, new[, max])
text1.replace(' ',