Emre Akman
Emre Akman

Reputation: 1213

AddressBook find formatted number with unformatted number

How can i find a phone number in the users addressbook when the users enters like for example 0612345678 but in the addressbook this phone number exist but with the format (06) 12 34 56 78 or +3112345678, so basicly my question is.. Is there a way to check for a phone number even if it has those formats?

Upvotes: 0

Views: 187

Answers (1)

Krunal
Krunal

Reputation: 1328

I have worked on the same concept. What I did is I get the phone number in NSString.

Now, I have a phone number like +(999)555-8888. So, to remove (), - and +, I have simply used NSString method stringByReplacingOccurrencesOfString:@"(" withString:@""....and did same for ), - and +.

And, finally, got 9995558888 as a result.

I think this may help you.....:)

Upvotes: 1

Related Questions