开发者

How to replace a "&" in received XML

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜