是否有更好或更短的办法来把目标C的所有非数字性质 strip在桌面上?
NSString * formattedNumber = @"(123) 555-1234";
NSCharacterSet * nonDigits = [[NSCharacterSet decimalDigitCharacterSet] invertedSet];
NSString * digits;
NSArray * parts = [formattedNumber componentsSeparatedByCharactersInSet:nonDigits];
if ( [parts count] > 1 ) {
digits = [parts componentsJoinedByString:@""];
} else {
digits = [parts objectAtIndex:0];
}
return digits;