博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
去掉字符串中不能作为文件名的特殊…
阅读量:4071 次
发布时间:2019-05-25

本文共 799 字,大约阅读时间需要 2 分钟。

- (NSString *)useAsFileName             // add by shjborage Apr 18, 2012

{
    NSString *strTmp = self;
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"/" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"\\" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@":" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"*" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"?" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"\"" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"<" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@">" withString:@" "];
    strTmp = [strTmp stringByReplacingOccurrencesOfString:@"|" withString:@" "];
    return strTmp;
}

转载地址:http://nneji.baihongyu.com/

你可能感兴趣的文章
jQuery中$('#selector).html('')是清空??----html()、text()、val()的区别
查看>>
欢迎使用CSDN-markdown编辑器
查看>>
Python使用web.py读取Mysql的数据
查看>>
web.py操作mysql的数据
查看>>
python类的详析
查看>>
web.py的两种更新Mysql数据的方法
查看>>
前端网址总结
查看>>
前端知识总结一
查看>>
Python 字符串的操作
查看>>
python安装依赖modules pysnmp pyasn1.type pexpect configparser
查看>>
Python操作Mongodb插入数据的两种方法:insert_one()与insert_many()
查看>>
Python函数式编程——匿名函数lambda
查看>>
Python的getattr(),setattr(),delattr(),hasattr()
查看>>
js中的constructor与prototype
查看>>
Ajax中的get和post请求比较
查看>>
'VBoxManage' is not recognized as an internal or external command, operable program or batch file.
查看>>
Linux VNC server的安装及简单配置使用
查看>>
解决RHEL6 vncserver 启动 could not open default font 'fixed'错误.
查看>>
Linux 下路由的设置
查看>>
CentOS/Linux 网卡设置 IP地址配置
查看>>