Last post Aug 16, 2011 08:55 PM by Prof_Teancum
Aug 16, 2011 08:15 PM|MyronCope|LINK
using asp.net/vb.net 2005
I want to check to see if a string contains any letters or numbers
to be clear, I am not requiring that the string only contain letters or numbers but only want to return true if the string contains at least one letter OR at least one number.
I am not doing this as a validation control, I need to do this based on data retrieved from a database field.
how to do this?
Aug 16, 2011 08:55 PM|Prof_Teancum|LINK
The easiest way is to use a regular expression: \d for a number \w for a letter. Example:
will tell you if the input string has a number in it.