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;

    }

  • 相关阅读:
    接口测试基础07
    性能测试基础01
    接口测试基础06
    将java list转换为js的数组
    java 网络编程
    java分页
    单例模式
    适配器模式
    抽象工厂模式
    工厂模式
  • 原文地址:https://www.cnblogs.com/shenlaiyaoshi/p/9103124.html
Copyright © 2011-2022 走看看