Get the extension of a file contained in an NSString

前端 未结 6 1981
[愿得一人]
[愿得一人] 2020-12-08 13:25

I have an NSMutable dictionary that contains file IDs and their filename+extension in the simple form of fileone.doc or filetwo.pdf. I need to determine what type of file it

6条回答
  •  余生分开走
    2020-12-08 13:48

    //NSURL *url = [NSURL URLWithString: fileType];
    NSLog(@"extension: %@", [fileType pathExtension]);
    

    Edit you can use pathExtension on NSString

    Thanks to David Barry

提交回复
热议问题