How to convert phone numbers to a standard format?

1.9k Views Asked by At

I need to develop back-end of an android application in which i will fetch contacts of a user from android phone and check whether any one of his contact is already in by db .
I need a good algorithm to match user contact numbers with number stored in Db.I am storing users number with their country code.(eg :"911234567890" for Indian number).but user will save contacts in different format(Eg 1234567890,+961 2345 6789,123-456-7890,+911234567890,01234567890 etc).How to convert these numbers to a standard format?

1

There are 1 best solutions below

0
On

Google's libphonenumber includes functions for parsing, formatting and validating phone numbers.