开发者

How to replace a "&" in received XML

开发者 https://www.devze.com 2023-03-22 02:34 出处:网络
I am receiving a list of inventory from a web service and so far one item has a \"&\" in it which messes up my parser. So far I 开发者_高级运维have tried:

I am receiving a list of inventory from a web service and so far one item has a "&" in it which messes up my parser. So far I 开发者_高级运维have tried:

street = [street stringByReplacingOccurrencesOfString:@"&" withString:@"and"];

but that didn't seem to work.


In the XML file, replace the & with &


Maybe you'll try

street = [street stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
0

精彩评论

暂无评论...
验证码 换一张
取 消