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];
精彩评论