我在Python中遇到了一个非常基本的字符串问题(我无法解决)。基本上,我正在尝试执行以下操作:
'# read file into a string
myString = file.read()
'# Attempt to remove non breaking spaces
myString = myString.replace("\u00A0"," ")
'# however, when I print my string to output to console, I get:
Foo **<C2><A0>** Bar
我之前认为"\u00A0"是表示Unicode不间断空格的转义码,但是似乎我没有正确地使用它。你们有什么想法,我做错了什么吗?