sentence =“我知道那天早上没有为她工作,但我仍然想和她约个约会。我的意思是,如果她睫毛浓密,那只是一开始的小毛病就我而言,这是值得的。”如何删除转义字符以清除数据?
我想,简单的re.sub
可能会起作用:
import re
string = '''
I understood that that morning did not work out for her but I would still like to to make an appointment with her. I mean if she does great lashes and it\'s just this one little hiccup in the beginning it\'s well worth it as far as I\'m concerned.
'''
expression = r'\\'
print(re.sub(expression, '', string))
[我知道那天早上对她没有帮助,但我会仍然想和她约会。我的意思是如果她这样做很好的睫毛,一开始只是这个小小的打cup就我而言,这是值得的。