I have a url that looks like this :
I want to be able to achieve something like this:
section = image;
value = ghwUT23Y;
I have tried to explode the url and usecomponentsSeperatedByString
method to grab the values I need.
if ([[explodedUrl firstObject] containsString:@"google.com"] && ![[explodedUrl firstObject] isEqualToString:@"https://google.com/"]) {
NSString *sectionString = [[[explodedUrl lastObject] componentsSeparatedByString:@"/"] firstObject];
NSLog(@"redirectttttt: %@",sectionString);
NSString *itemString = [[[explodedUrl lastObject] componentsSeparatedByString:@"/"] lastObject];
NSLog(@"redirectttttt:2 %@",itemString);
Problem:
Using this method, itemString
returns me the value : ghwUT23Y.jpeg
but sectionString
returns me https://
How would I be able to get image
as a section?