0
我在解析XML时遇到问题。 我有一个NSMutablestring currentElementValue,它有新行。它已经作为一个来自网络源的XMl收到。 即使当我试图删除子字符串的前3个字符串的前3个字符时,对字符串没有影响。XML解析时删除换行符
这里可以做些什么? 问候
PC
代码是
(void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string {
if(!currentElementValue)
currentElementValue = [[NSMutableString alloc] initWithString:string];
else
{
[currentElementValue substringFromIndex:3];
[currentElementValue stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
NSLog(@"Processing Value : %@ with length %d", currentElementValue,[currentElementValue length]);
}