Hi,
i would like to cut the 1st '0'
You can try CString::TrimLeft
e.g. CString str = _T ("090");
str = str.Trimeft (_T ('0'));
Note: it will not erase only the first '0', it will trim all leading '0's.
e.g. CString str = _T ("00090");
>i want to check whether it has a space there and return an error message. e.g. '0 9 0', then it will return an error
try CString::Find
e.g. CString str = _T ("0 9 0");
//trim leading '0'
str = str.Trimeft (_T ('0'));
//Search space
if( str.Find (_T (' ')) != -1 )
{
//found space, do what you want
}
Yours,
Michael
"NEMA" wrote:
How can i check the String letters?
i have a textbox and will filled with numbers.
i want to check if the number contain a '0' in font of the numbers,
e.g. '090',i would like to cut the 1st '0', that will change to '90'.
and i want to check whether it has a space there and return an error
message. e.g. '0 9 0', then it will return an error.
i really dont know how to do it? please give me some guidliance,
thanks.