更新电话号码格式

更新电话号码格式

本文介绍了更新电话号码格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 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: 0000000000I need to update the phone number format to: (000) 000-0000Is 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 AccessdbUPDATE 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")OrDim 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[^] 这篇关于更新电话号码格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-20 00:57