开发者

.NET Phone Number Parsing Library

Does anyone know of a generic phone number parsing library for .NET?开发者_JAVA百科 Ideally I'm looking for something similiar to the Ruby Phone library.


I would go with the C# port of the Google libphonenumber library.

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


I'd recommend going with libphonenumber from Google, here's a blog post on how to use libphonenumber.

Parsing numbers is as easy as installing the NuGet package and then doing this:

var util = PhoneNumberUtil.GetInstance();
var number = util.Parse("555-555-5555", "US");


You could start with Advanced Phone Number Type Implementation on CodeProject. At first glance, it seems that it may be lacking the internationalization pieces found in the Ruby library you referenced.

Of course, you could always start with an existing library and add on to it, and depending on the license of the original library, you might even choose to release your own that has exactly what you need.


Have you considered taking the Ruby library you referenced and porting it to IronRuby, which runs on the .NET DLR? I haven't used IronRuby before, but since it's a .NET language, you may be able to simply port the code over and expose and strongly-typed interface that can be better consumed in VB.NET or C#.


There's an alternative port of Google's libphonenumber on CodePlex. It doesn't seem as popular as the other one, but it looks like it's based on a newer version of the library and it looks like it's still being developed.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜