![]() |
|
|
Published: Tuesday, September 07, 1999 isAlpha for ASP
For those C programmers out there, you know what I'm talking about! For those who don't, there
is a standard C function called
Well, this isn't too difficult to do using ASP. We just need to create a function that takes as its input a string, and returns true if the string contains just alpha characters, and false otherwise. So let's look at some code!
This function loops through the input string one character at a time. If the current character it's examining isn't A-Z, it returns false. If we loop through the entire string and all characters are between A to Z, then we return true.
We could make use of this function by a few simple lines of ASP code. Imagine that we have a form that
calls this ASP page when submitted. In that form, there was a field called
This simple example demonstrates how to use the I hope you find this script useful! As always, if you have any comments, ideas, or criticisms, I encourage you to send me feedback! Happy Programming!
Attachments: isAlpha in text format
Related Articles Asc functionMid functionUCase function
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||