- 过滤特定字符
NSCharacterSet *filterSet = [NSCharacterSet characterSetWithCharactersInString:@"[]{}(#%-*+=_)\\|~(<>$%^&*)_+b/<>"];
sourceMdl.name = [[sourceMdl.name componentsSeparatedByCharactersInSet: filterSet] componentsJoinedByString: @""];
NSCharacterSet *filterSet = [NSCharacterSet characterSetWithCharactersInString:@"[]{}(#%-*+=_)\\|~(<>$%^&*)_+b/<>"];
sourceMdl.name = [[sourceMdl.name componentsSeparatedByCharactersInSet: filterSet] componentsJoinedByString: @""];
本文标题:iOS开发小点·NSString过滤特定字符
本文链接:https://www.haomeiwen.com/subject/fgldzftx.html
网友评论