Search code examples
c#dlltypesphone-number

Why doesn't a phone number datatype/library exist


Just wondering if anyone is aware of any low level phone number storage constructs for C#. I have been surprised to find that all of my searches have proved fruitless for such a library.

Essentially I am hoping for something that can take a string phone number input (in all its varied goodness) and both validate and segment the given string into its various sections (IE: country code, area code, number) along with providing a common format to store this data.

Does any such library exist? If not, any idea why something like this hasn't been attempted? (Is it really that hard a problem?)


Solution

  • So it turns out there is actually a pretty awesome library available after all.

    Original Java version: http://code.google.com/p/libphonenumber/

    C# version: https://bitbucket.org/pmezard/libphonenumber-csharp/wiki/Home

    Me discussing the library on my blog.