Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS: Splitting NSString into FilePath&Name + Extension

iOS: Splitting NSString into FilePath&Name + Extension

How do I split

@"blah/.../myfile.txt"

into

@"blah/.../myfile" 

and

@"txt"
like image 893
P i Avatar asked Jul 17 '11 10:07

P i


1 Answers

NSString* fileName = [fileString stringByDeletingPathExtension];
NSString* extension = [fileString pathExtension];
like image 169
P i Avatar answered Sep 21 '22 11:09

P i