c# - 在 C# 中格式化电话号码的最快方法?

标签 c#

使用 c# 使用美国电话格式 [(XXX) XXX-XXXX] 格式化字符串的最快方法是什么?

我的源格式是一个字符串。

最佳答案

String.Format("{0:(###) ###-#### x ###}", double.Parse("1234567890123"))

将导致 (123) 456-7890 x 123

关于c# - 在 C# 中格式化电话号码的最快方法?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/679740/

相关文章:

c# - 对选择合适的 ORM 感到困惑?

c# - 尝试使用参数启动 PointF

c# - SubSonic ActiveRecord 模板 : generated code produces error converting int? 到 int

c# - 为什么使用 wireshark 捕获一个 c# ssl 服务器/客户端程序得到 TCP 包?

C# 如何在 process.arguments 中使用目录空白?

c# - 如何将 List<ExpandoObject> 转换为 XML 字符串

c# - 理解这个 Lambda 表达式

C# 将 DateTime 从一种格式转换为另一种格式

c# - 当 Camera.targetTexture = new RenderTexture(...) 时内存泄漏

c# - 如何让用户编辑list<T>内容?