iOS开发小点·NSString过滤特定字符

  • 过滤特定字符
NSCharacterSet *filterSet = [NSCharacterSet characterSetWithCharactersInString:@"[]{}(#%-*+=_)\\|~(<>$%^&*)_+b/<>"]; 
sourceMdl.name = [[sourceMdl.name componentsSeparatedByCharactersInSet: filterSet] componentsJoinedByString: @""];