Check if the given string is AlphaNumeric
This code sample returns true if the passed stirng contains only alpha numeric characters.
Public Shared Function IsAlphaNumeric(ByVal strToCheck As String) As Boolean
Dim pattern As Regex = New Regex("[^a-zA-Z0-9]")
Return Not pattern.IsMatch(strToCheck)
End Function
Public Shared Function IsAlphaNumeric(ByVal strToCheck As String) As Boolean
Dim pattern As Regex = New Regex("[^a-zA-Z0-9]")
Return Not pattern.IsMatch(strToCheck)
End Function
Labels: Regular Expression

0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home