首页 > 代码库 > json去掉多余斜杠

json去掉多余斜杠

+ (NSString *) getOffRubbishWithString:(NSString *)str

{

    NSMutableString *responseString = [NSMutableStringstringWithString:str];

    NSString *character =nil;

    for (int i =0; i < responseString.length; i ++) {

        character = [responseString substringWithRange:NSMakeRange(i,1)];

        if ([characterisEqualToString:@"\\"])

            [responseString deleteCharactersInRange:NSMakeRange(i,1)];

    }

    

    [responseString stringByReplacingOccurrencesOfString:@"\‘"withString:@""];

    

    return responseString;

}

json去掉多余斜杠