I have some source code to get the file name of an url
for example:
http://www.google.com/a.pdf
I hope to get a.pdf
because the way to join 2 NSS
Try this:
Edit: from blow comment
NSString *url = @"http://www.google.com/a.pdf"; NSArray *parts = [url componentsSeparatedByString:@"/"]; NSString *filename = [parts lastObject];