Noung Noung - 1 year ago 187
Objective-C Question

Objective c Substring

Please help me, I want to Substring like that " "
and I want to get " abc.pdf ". It mean I want to get file name of pdf.

Note: it is not the same string.
Forexample :, and sometime


Answer Source

Use the lastPathComponent method of NSURL.

NSURL *url = [NSURL URLWithString:@""];
NSString *filename = [url lastPathComponent];
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download