0

How to get the proper url link from the tag value. I have used NSXMLParser for parsing and parsed content successfully but stucked with the url value like:

<value> http://example.site.com/%3Ca%20href%3D%22/taxonomy/term/3%22%3ETheater%3C/a%3E </value>

I have tried with some string replacement operation but not any good result.

How i format that string value and get the exact url string.

Thanks in advance :)

Batman4Ever
  • 189
  • 2
  • 11

1 Answers1

0

Try this

NSString *value = @"http://example.site.com/%3Ca%20href%3D%22/taxonomy/term/3%22%3ETheater%3C/a%3E";


NSString *formattedValue = [value stringByReplacingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSArray *array = [formattedValue componentsSeparatedByString:@"<a"];
NSLog(@"%@",[array objectAtIndex:0]);
Inder Kumar Rathore
  • 39,458
  • 17
  • 135
  • 184
  • thanks Inder for your reply. i am having this value after using your code "http://example.site.com/Theater" but i want to ignore those tags too accepting answer :) – Batman4Ever Jul 22 '13 at 15:09