Validating a string...
Posted on 2002-06-19
Here is my problem. I'm trying to parse a string that is entered by a user to make it conform to certain rules.
For example I needed to do this with a phone number so the function would strip out all of the non-numeric characters. White space and "-", "(", and so-on.
My function that accomplishes this is
void TForm1::StripPhoneNumber(char * dest, char * src)
*(dest++) = *src;
*dest = 0;
It works well, but now i'm trying to do something similar but that keeps all letters and digits. For instance,
1-800-ABC-DEFG would still return 1800ABCDEFG, and not just 1800.
All I really need is an isletter equivalent to isdigit to put in the if statement. Does such a function exist?