NSString *string = @"<a href=\"http\">这是要截取的内容</a>";
NSRange startRange = [string rangeOfString:@"\">"];
NSRange endRange = [string rangeOfString:@"</"];
NSRange range = NSMakeRange(startRange.location + startRange.length, endRange.location - startRange.location - startRange.length);
NSString *result = [string substringWithRange:range];
NSLog(@"%@",result);
网友评论