iOS开发小点·NSString过滤特定字符
2018-10-17 本文已影响80人
小码僧
- 过滤特定字符
NSCharacterSet *filterSet = [NSCharacterSet characterSetWithCharactersInString:@"[]{}(#%-*+=_)\\|~(<>$%^&*)_+b/<>"];
sourceMdl.name = [[sourceMdl.name componentsSeparatedByCharactersInSet: filterSet] componentsJoinedByString: @""];