ExtensionMethod.NET Home of 880 C#, Visual Basic, F# and Javascript extension methods

IsPhoneFax

Check string that contains valid Phone / Fax

Source

<Extension()> _
Public Function IsPhoneFax(ByVal value As String) As Boolean
    Dim reg As Regex = New Regex("^[2-9]\d{2}-\d{3}-\d{4}$")
    Return reg.IsMatch(value)
End Function

Example

Textbox1.Text.IsPhoneFax

Author: NetDorkie

Submitted on: 16 jul. 2009

Language: VB

Type: System.String

Views: 4398