- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
+(NSString*)filterDigits:(NSString*)number
{
unichar zer = '0', nine = '9', cur;
unsigned long l = [number length];
NSMutableData *buf = [NSMutableData data];
for (unsigned long j = 0; j!=l; j++)
{
cur = [number characterAtIndex:j];
if (cur>=zer&&cur<=nine)
{
char digit = (char)cur;
[buf appendBytes:&digit length:sizeof(char)];
}
}
NSString* ret = [[[NSString alloc] initWithData:buf encoding:NSUTF8StringEncoding] autorelease];
return ret;
}