NSString *path=@"/users/liyang/desktop/liyang.txt"; NSLog(@"%@",[path pathExtension]);//返回路径的拓展名
NSString *path=@"/users/liyang/desktop/liyang.txt"; NSLog(@"%@",[path stringByDeletingPathExtension]);//删掉拓展名
NSString *path=@"/users/liyang/desktop/liyang.txt"; NSLog(@"%@",[path stringByAppendingPathExtension:@"docr"]);//拼接一个拓展名