我有设置在的字符串 bp
s1 = '[\'<li class="list__item">Accommodates most miter saws; free adapter brackets ' \
'for offset mounting holes with holes included</li>\', \'<li class="list__item">' \
'Trigger handle quick release tool mounts for mounting or removing miter saw ' \
'quickly and easily</li>\', \'<li class="list__item">Adjustable arms extend out to ' \
'provide 116 in. of material support</li>\', \'<li class="list__item">Fast and easy ' \
'setup with snap pin lock folding legs</li>\', \'<li class="list__item">Easy height ' \
'adjustment of material supports with no tools required</li>\', \'<li ' \
'class="list__item">Stand collapses down quickly for easy storage and transport</li>\', ' \
'\'<li class="list__item">20 in. quick attach tool mounts may be used as miter saw base ' \
'on most surfaces</li>\', \'<li class="list__item">Durable powder-coated finish</li>\', ' \
'\'<li class="list__item">Includes: folding portable miter saw stand and operator ' \
' manual</li>\', \'<li class="list__item">90-day returnable</li>\']'
我想删除所有的 '[\' 和 \ 以及逗号有什么办法可以做到吗?
你没有说用什么替换它们,所以我用空字符串替换它们
#!python3
s1 = '[\'<li class="list__item">Accommodates most miter saws; free adapter brackets ' \
'for offset mounting holes with holes included</li>\', \'<li class="list__item">' \
'Trigger handle quick release tool mounts for mounting or removing miter saw ' \
'quickly and easily</li>\', \'<li class="list__item">Adjustable arms extend out to ' \
'provide 116 in. of material support</li>\', \'<li class="list__item">Fast and easy ' \
'setup with snap pin lock folding legs</li>\', \'<li class="list__item">Easy height ' \
'adjustment of material supports with no tools required</li>\', \'<li ' \
'class="list__item">Stand collapses down quickly for easy storage and transport</li>\', ' \
'\'<li class="list__item">20 in. quick attach tool mounts may be used as miter saw base ' \
'on most surfaces</li>\', \'<li class="list__item">Durable powder-coated finish</li>\', ' \
'\'<li class="list__item">Includes: folding portable miter saw stand and operator ' \
' manual</li>\', \'<li class="list__item">90-day returnable</li>\']'
s1 = s1.replace("[", "").replace("\\", "").replace(",", "").replace("]", "")
print(s1)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句