Is String Numeric
-4
Is String Numeric
BOOL IsStringNumeric(CString strString)
{
// Do not test for comma's
// See if string is numeric or not
if (strString.FindOneOf("1234567890") == -1 || strString.FindOneOf("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~[]{}-_=+\\|'/?><") != -1)
{
return false;
}
return true;
}
{
// Do not test for comma's
// See if string is numeric or not
if (strString.FindOneOf("1234567890") == -1 || strString.FindOneOf("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~[]{}-_=+\\|'/?><") != -1)
{
return false;
}
return true;
}





Another even simpler approach would be to use regex. ie: boost::regex
- Billism