Created
August 13, 2012 08:30
-
-
Save piaoapiao/3338250 to your computer and use it in GitHub Desktop.
replace iphone Number
This file contains hidden or 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 *str =@"123(3 24) +8678"; | |
NSString *result = [str stringByReplacingOccurrencesOfString:@"(" withString:@" "]; | |
result = [result stringByReplacingOccurrencesOfString:@")" withString:@" "]; | |
result = [result stringByReplacingOccurrencesOfString:@"+86" withString:@" "]; | |
result = [result stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
result = [result stringByReplacingOccurrencesOfString:@" " withString:@""]; | |
NSLog(@"result:%@",result); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment