I am getting an error. I am attempting to convert a phone number with () and - to the 10 digit format. Also, I would like 7 digit numbers converted to 10 also, but I think I can handle that once I get this going. Anyways, let me know if you have any tips. Thanks!
Error:
I got the example from:Code:Error 1 Overload resolution failed because no accessible 'New' accepts this number of arguments. C:\Documents and Settings\User\My Documents\Visual Studio 2008\Projects\JeffComputersPOS1\JeffComputersPOS1\frmPreTicket.vb 34 14 JeffComputersPOS1
http://www.4guysfromrolla.com/webtech/031302-1.shtml
vb Code:
Function get10DigitPhoneNumber(ByVal strUnformattedPN As String) As String 'Create a regular expression object Dim re re = New System.Text.RegularExpressions.Regex 'RegExp was the example, but it did not work either 'System.Text.RegularExpressions 'Specify the pattern re.Pattern = "(\d{3})(\d{3})(\d{4})" 'Use the replace method to perform the formatting Dim strFormattedPN Return re.Replace(strUnformattedPN, "($1) $2-$3") End Function
