I want get extension (format file from NSString) but I dont know about it please tell me syntax for getting format file from NSString.
NSString *name = @"Xcode-tutorial.pdf"
I want get .pdf format and store in one variable
I want get extension (format file from NSString) but I dont know about it please tell me syntax for getting format file from NSString.
NSString *name = @"Xcode-tutorial.pdf"
I want get .pdf format and store in one variable
Use NSString
s pathExtension
method:
NSString *fileExtension = [name pathExtension];
Did you look in the documentation? There is a method that does just that:
NSString *ext = [name pathExtension];
NSLog(@"%@", ext);