Re: easily search Address Book for phone numbers in various formats?
Re: easily search Address Book for phone numbers in various formats?
- Subject: Re: easily search Address Book for phone numbers in various formats?
- From: Chris Blättermann <email@hidden>
- Date: Mon, 11 Feb 2008 16:18:23 +0100
Hi Steve!
A quick-and-dirty solution would be parsing out all the characters
which are not numbers and start the search with the modified string.
Like +808-555-1212 would become 8085551212. Then you loop through all
the contacts, read out the number and convert it the same way.
Comparing these two strings with isEqualToString:.
Another way would be regular expressions, but I'm not very good at it.
Kind regards,
Chris Blaettermann
Am 11.02.2008 um 12:06 schrieb Stephen Zyszkiewicz:
I'd like to use the Address Book framework to search for phone
numbers in various formats. I would like to match up a phone number
with a contact. The phone number may look like +808-555-1212 or
8085551212 or +8085551212. Is there any way to easily do this with
the AB framework or perhaps someone has figured this out already?
Thank you!!
Steve
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden