如何从以下
获取网址[bpfb_link url ='http://www.abcd.com/'title ='abcd Technologies :: 主页'image ='http://www.abcd.com//images/itwall_b1.gif'] [/ bpfb_link]
以上链接i retrieved
从php
方法转换为xml
。如何从formatted url
获得above tag
。
我想用componentsseperatedBystring
来获取字符串,但格式每次都会改变。
我正在执行以下操作以删除不需要的字符串
NSRange rangeLink = [[[arrUpdates valueForKeyPath:@"content"]objectAtIndex:intIndexPath] rangeOfString:@"bpfb_link"];
if (rangeLink.location != NSNotFound)
{
NSArray *arrNewLink=[[[arrUpdates valueForKeyPath:@"content"]objectAtIndex:intIndexPath] componentsSeparatedByString:@"["];
NSLog(@"arrNewLink %@",[arrNewLink objectAtIndex:0]);
//[[arrNewLink objectAtIndex:1] componentsSeparatedByString:@"]"];
NSArray *arrEditedLinks=[[arrNewLink objectAtIndex:1]componentsSeparatedByString:@"]"];
NSLog(@"arrEditedLinks %@",[arrEditedLinks objectAtIndex:1] );
}
请帮帮我
答案 0 :(得分:0)
如果您的回答是不变的,那么您可以这样做
NSString *temp=@"[bpfb_link url='http://www.abcd.com/' title='abcd Technologies : : Home Page' image='http://www.abcd.com//images/itwall_b1.gif'] [/bpfb_link]";
NSArray *arr=[[NSArray alloc]init];
arr=[temp componentsSeparatedByString:@"'"];
NSLog(@"arr %@",[arr objectAtIndex:1]);
out put is-- http://www.abcd.com/