Last active
August 29, 2015 14:03
-
-
Save tomisacat/dd53c6b37e694e35feda to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *pattern = @"([\\.\\+\\(\\)\\-\\_\\s])"; | |
NSRegularExpression *re = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil]; | |
NSString *replaced = [re stringByReplacingMatchesInString:phoneNumber options:0 range:NSMakeRange(0, [phoneNumber length]) withTemplate:@""]; | |
NSLog(@"%@", replaced); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
将电话号码中的空格、括号、加号、连字符、点号和下划线去掉
In English: remove white space character,parentheses,hyphen,underline,plus character