iOS 字符串中去除特殊符号 stringByTrimmingCharactersInSet

</pre><p></p><pre name="code" class="objc">#import "NSString+change.h"

@implementation NSString (change)
- (NSString *)removeSpecilaStr
{
    NSCharacterSet *set = [NSCharacterSet characterSetWithCharactersInString:@"@/:;()¥「」"、[]{}#%-*+=_\\|~<>$€^•'@#$%^&*()_+'\""];
    NSString *trimmedString = [self stringByTrimmingCharactersInSet:set];
    return trimmedString;
}
@end




你可能感兴趣的:(ios,过滤,特殊字符)