我的字符串是'MRK\xa0Software\xa0Services\xa0Private\xa0Limited'
,我想\xa0
用空格替换十六进制部分 ( ),这样我得到
MRK Software Services Private Limited
我可以进一步拆分成不同的词。
myString = "MRK\xa0Software\xa0Services\xa0Private\xa0Limited"
newString = myString.replace("\xa0", " ")
如果您收到 unicode 错误,您可以尝试:
newString = myString.replace("\\xa0", " ")
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句