How to replace \xA0 characters in an NSString

烂漫一生 提交于 2019-12-12 04:12:19

问题


The following code doesn't work:

NSString *importText = [textView.string stringByReplacingOccurrencesOfString:@"\xA0\xA0"
 withString:@" "];

Compiler claims: "Input conversion stopped due to an input byte that don't belong to the input code set UTF8"


回答1:


Try the Unicode escape sequence \u00a0.



来源:https://stackoverflow.com/questions/12643955/how-to-replace-xa0-characters-in-an-nsstring

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!