所以,我有一个文本字符串,我想从中删除“”。你知道吗
这是我的文本字符串:
string= 'Sample this is a string text with "ut" '
下面是我使用regex表达式想要的输出:
string= 'Sample this is a string text with ut'
这是我的总体代码:
import re
string= 'Sample this is a string text with "ut" '
re.sub('" "', '', string)
输出只显示字符串中的精确文本,没有任何更改。有什么建议吗?你知道吗
您只需使用
string.replace('"','')
如果只想删除所有
"
符号,可以改用str.replace
:string = string.replace('"', '')
相关问题 更多 >
编程相关推荐