zoukankan      html  css  js  c++  java
  • ios -过滤字符串特殊字符

    //过滤 " [ ] "

    + (NSString *)onTwoCommseparatedWithString:(NSString *)string

    {

        //过滤 " [ ] "

        string = [string stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"""]];

        string = [string stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"["]];

        string = [string stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"""]];

        string = [string stringByTrimmingCharactersInSet:[NSCharacterSet characterSetWithCharactersInString:@"]"]];

        string = [string stringByReplacingOccurrencesOfString:@""" withString:@""];

        string = [string stringByReplacingOccurrencesOfString:@"\" withString:@""];

    //    string = [string stringByReplacingOccurrencesOfString:@"/" withString:@"/"];//替换字符

        

     

        

        return string;

    }

  • 相关阅读:
    HttpClient Coder Example
    HttpClient容易忽视的细节—连接关闭
    Hibernate中所有包作用详细讲解
    Commons-VFS 使用SFTP
    Ant 编译项目资源不足
    ActiveMQ介绍和ActiveMQ入门实例
    ActiveMQ与MSMQ的异同
    linux nohup命令详解
    linux sed命令详解
    linux iptables命令详解
  • 原文地址:https://www.cnblogs.com/shenlaiyaoshi/p/9103124.html
Copyright © 2011-2022 走看看