ios带后缀名的字符串的截取
来源:互联网 发布:ipad广告拦截软件 编辑:程序博客网 时间:2024/05/20 07:51
//这里有一个模拟器沙盒路径(完整路径)
NSString* index=@"/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books/2013_50.zip";
对路径截取的9种操作
NSLog(@"1=%@",[index lastPathComponent]);
NSLog(@"2=%@",[index stringByDeletingLastPathComponent]);
NSLog(@"3=%@",[index pathExtension]);
NSLog(@"4=%@",[index stringByDeletingPathExtension]);
NSLog(@"5=%@",[index stringByAbbreviatingWithTildeInPath]);
NSLog(@"6=%@",[index stringByExpandingTildeInPath]);
NSLog(@"7=%@",[index stringByStandardizingPath]);
NSLog(@"8=%@",[index stringByResolvingSymlinksInPath]);
NSLog(@"9=%@",[[index lastPathComponent] stringByDeletingPathExtension]);对应结果
1=2013_50.zip
2=/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books
3=zip
4=/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books/2013_50
5=~/Documents/DownLoad/books/2013_50.zip
6=/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books/2013_50.zip
7=/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books/2013_50.zip
8=/Users/junzoo/Library/Application Support/iPhone Simulator/7.0.3/Applications/63925F20-AF97-4610-AF1C-B6B4157D1D92/Documents/DownLoad/books/2013_50.zip
9=2013_50- ios带后缀名的字符串的截取
- 截取带汉字的字符串
- PHP截取后缀名的方法
- 截取带括号和逗号的字符串
- 截取带emoji表情的utf8字符串
- Qt 截取文件路径后的后缀名
- 截取文件后缀名的几种方式
- 【iOS】Swift字符串截取方法的改进
- [IOS]Swift字符串截取方法的改进
- iOS字符串的截取、匹配、分割
- iOS开发中字符串的截取
- iOS 后缀名文件的区别
- iOS-截取字符串中两个指定字符串中间的字符串
- iOS-截取字符串中两个指定字符串中间的字符串
- iOS-截取字符串中两个指定字符串中间的字符串
- js 文件名截取(后缀名、全名、不带后缀名)
- 按字节长度截取字符串(支持截取带HTML代码样式的字符串)
- 按字节长度截取字符串(支持截取带HTML代码样式的字符串)
- Ruby元编程-学习笔记(二)-方法
- 一句话木马常用方法
- [http]get post put delete 简介
- 目前刚接触码农世界没多久,知识有限
- HDU-6189 number number number(矩阵快速幂)
- ios带后缀名的字符串的截取
- Java 常用排序算法/程序员必须掌握的 8大排序算法
- 深度学习中的docker容器使用
- Mybatis实现批量更新
- 关于在ie8浏览器下碰到的一些兼容问题
- psutil工具
- S3C2440 U-Boot补丁
- 关于MVP+CLEAN 框架的理解
- Maven 详解