IsValidUsSSN – Validating a US Social Security Number (SSN)

' Validate a US Social Security Number' Example:'   MessageBox.Show(IsValidUsSSN("123-12-1234"))  ' True'   MessageBox.Show(IsValidUsSSN("123-123-1234")) ' FalseFunction IsValidUsSSN(ByVal ssn As String) As Boolean    Return System.Text.RegularExpressions.Regex.IsMatch(ssn, _        "^d{3}-d{2}-d{4}$")End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Overview

Recent Articles: