.NET 电话号码解析库

发布于 2024-09-18 01:43:50 字数 120 浏览 5 评论 0原文

有谁知道 .NET 的通用电话号码解析库吗?理想情况下,我正在寻找类似于 Ruby Phone 库的东西。

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

世俗缘 2024-09-25 01:44:10

CodePlex 上有 Google libphonenumber 的替代端口。它看起来不像另一个那么受欢迎,但看起来它是基于该库的较新版本,并且看起来仍在开发中。

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.

归属感 2024-09-25 01:44:08

您是否考虑过将您引用的 Ruby 库移植到在 .NET DLR 上运行的 IronRuby?我以前没有使用过 IronRuby,但由于它是一种 .NET 语言,因此您可以简单地移植代码并公开强类型接口,以便在 VB.NET 或 C# 中更好地使用。

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#.

汹涌人海 2024-09-25 01:44:04

您可以从高级电话号码类型实现开始href="http://www.codeproject.com" rel="nofollow noreferrer">CodeProject。乍一看,它似乎缺少您引用的 Ruby 库中找到的国际化部分。

当然,您始终可以从现有库开始并向其添加内容,并且根据原始库的许可证,您甚至可以选择发布自己的库,其中包含您所需要的内容。

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.

尐籹人 2024-09-25 01:44:02

我建议使用 Google 的 libphonenumber,这是 有关如何使用 libphonenumber 的博客文章

解析数字就像安装 NuGet 包 一样简单,然后执行以下操作:

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

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");
只是偏爱你 2024-09-25 01:44:00

我会选择 Google libphonenumber 库的 C# 端口。

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

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文