gpt4 book ai didi

python - 如何删除弯引号?

转载 作者:太空宇宙 更新时间:2023-11-03 12:22:32 24 4
gpt4 key购买 nike

在我的 utf-8 编码文件中,有大引号(“”)。

如何用普通引号 (") 替换它们?

cell_info.replace('“','"')
cell_info.replace('”','"')

没用。没有错误信息。

谢谢。 :)

最佳答案

str.replace() 不会替换原始字符串,它只是返回一个新字符串。

做:

cell_info = cell_info.replace('“','"').replace('”','"')

关于python - 如何删除弯引号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3428876/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com