Your character isn't a ':', it's ':'
Try:
int index = myString.Find( _T(':') );
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I want to find if the character ':' is present in a Chinese string "1.00 单位:14.30 单位".
But it is returning me -1 all the time though the character ':' is present in the above string.
CString myString = _T( "1.00 单位:14.30 单位");
int index = myString.Find(':');
Here I am expecting the 'index' value to be 7 but getting as -1.
Thanks in advance for any suggestion or help.
Your character isn't a ':', it's ':'
Try:
int index = myString.Find( _T(':') );