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]);
}