MFC的cstring判断是否存在中文字符

bool IsChinese(CString Cstr)
{
	int nLen = Cstr.GetLength();
	unsigned char ch1, ch2;
	for (int i = 0; i != nLen; ++i)
	{
		ch1 = Cstr[i];
		if (ch1 >= 0xA0)
		{
			return true;
		}
		else
		{
			continue;
		}
	}
	return false;
}

  

posted @ 2019-07-31 13:55  HappyCoder_1  阅读(875)  评论(0编辑  收藏  举报