python strip 多删掉掉字符 问题
为何 strip 会多删掉1个字符
text = "cntaobaothree"
a = text.strip("cntaobao")
# 结果为:hree
为何 strip 会多删掉1个字符
text = "cntaobaothree"
a = text.strip("cntaobao")
# 结果为:hree
strip删除的是包含其中每一个的字符,不是整体,要整体,就用text.replace('cntaobao','')