我想从中删除"
,NSString
但它不起作用。
该字符串来自 XMLParser:
- (void)parser:(NSXMLParser *)parser
didEndElement:(NSString *)elementName
namespaceURI:(NSString *)namespaceURI
qualifiedName:(NSString *)qName
{
if([elementName isEqualToString:@"li"]){
_isAnswer = NO;
}else if([elementName isEqualToString:@"span"]){
NSString *immutableString = [NSString stringWithString:currentElementValue];//currentElementValue is myMutableString
NSString* myString = [immutableString stringByReplacingOccurrencesOfString:@"\"" withString:@"00000"];
myString = [myString stringByReplacingOccurrencesOfString:@"״" withString:@"00000"];
myString = [myString stringByReplacingOccurrencesOfString:@"“" withString:@"00000"];
myString = [myString stringByReplacingOccurrencesOfString:@"”" withString:@"00000"];
NSLog (@"myString - ", myString); } }
来自 xml 的字符串有一个
"
日志:
myString - this is the " string
代替:
myString - this is the 00000 string