Link to home
Start Free TrialLog in
Avatar of BPatroch
BPatroch

asked on

Check for alpha numeric string

is there an easy way to check and see if a string is alphanumeric, no special characters, no spaces.  For my application the string would also allow underscores.  Thanks
Avatar of aelatik
aelatik
Flag of Netherlands image

This would do :

If IsNumeric(Replace(YourString, "_", "")) Then
    Response.write ("String is Numeric")
Else
    Response.write ("String is NOT Numeric")
End If
The problem with IsNumeric is that the following:
12E34
12D34
-1234
 is also returned as true.  You may want to take a look at Regular Expressions.  Let me know if you need an example.

Anthony
ASKER CERTIFIED SOLUTION
Avatar of ap_sajith
ap_sajith

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial