更新电话号码格式

编程入门 行业动态 更新时间:2024-10-26 13:27:49
本文介绍了更新电话号码格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

hiii .... 在Access数据库中,我有大约100个db记录,其中包含以下格式的电话号码:0000000000 我需要将电话号码格式更新为:(000)000-0000 有没有一种快捷的方法可以做到这一点不手动更改每条记录?他们是一个可以解决这个问题的正则表达式吗? 我用过这个函数但它显示错误为子串,Concat是Undifinedplz给出一些解决方案.....我正在使用Accessdb

更新 表 SET phone_number = CONCAT( ' (', SUBSTR(phone_number, 1 , 3 ), ' )', ' ', SUBSTR(phone_number, 5 , 3 ), ' - ', SUBSTR(phone_number, 9 , 3 ))

解决方案 试试这个:

Dim phoneNumber As 字符串 = 1234567890 phoneNumber = Cint (phoneNumber).ToString( (000)000-0000)

Dim Phone as String = 1234567890 Label1.Text = Phone.ToString.Format( ({0}){1} - {2} ,Phone.Substring( 0 , 3 ), Phone.Substring ( 3 , 3 ),Phone.Substring( 6 , 4 ))

发现它这里 [ ^ ]

hiii.... In the Access database I have about 100 db records with the phone number in this format: 0000000000 I need to update the phone number format to: (000) 000-0000 Is there a quick way I could do this without changing each record manually? Is their a regular expression that could solve this problem? I had Used This Function But it Showing The Error As "Substring,Concat are Undifined" plz give some Solution.....am Using Accessdb

UPDATE table SET phone_number = CONCAT( '(', SUBSTR(phone_number, 1, 3), ')', ' ', SUBSTR(phone_number, 5, 3), '-', SUBSTR(phone_number, 9, 3) )

解决方案

Try this:

Dim phoneNumber As String = "1234567890" phoneNumber = Cint(phoneNumber).ToString("(000) 000-0000")

Or

Dim Phone As String = "1234567890" Label1.Text = Phone.ToString.Format("({0}) {1}-{2}", Phone.Substring(0, 3), Phone.Substring(3, 3), Phone.Substring(6, 4))

Found it here[^]

更多推荐

更新电话号码格式

本文发布于:2023-10-27 22:37:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1534757.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:电话号码   格式

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!