A
Alamelu
Hi,
I want to check if cstring contains alphabets, numerics and comma. No other
characters are allowed. Any methods available in cstring?
The below code doesnt work. Could you Plz suggest any other better approach
CString strTemp = _T("abcde,54");
for(int i = 0; i <= strTemp.GetLength() ; i++)
{
if(isalnum(strTemp)
||strTemp == ",")
{
}
else
{
cout << "Contains illegal char";
}
}
Regards,
Alamelu
I want to check if cstring contains alphabets, numerics and comma. No other
characters are allowed. Any methods available in cstring?
The below code doesnt work. Could you Plz suggest any other better approach
CString strTemp = _T("abcde,54");
for(int i = 0; i <= strTemp.GetLength() ; i++)
{
if(isalnum(strTemp)
||strTemp == ",")
{
}
else
{
cout << "Contains illegal char";
}
}
Regards,
Alamelu