如何在Python中替换字符串中的=\

2024-09-19 23:29:20 发布

您现在位置:Python中文网/ 问答频道 /正文

{{cd2>要用下面的小脚本替换} 我不知道为什么它不起作用。也许有人能帮我

这是我的尝试:

input = r"asdffdsa\=qwert,  trewert\=qwerqwer"
print input
output = input.replace("=\\", "=")
print output

print input.find("=\\")

我得到以下输出:

^{pr2}$

Tags: 脚本inputoutputfindreplaceprintqwertcd2