判断字符串是否含有中文 C++

来源:互联网 发布:算法优先语法分析器 编辑:程序博客网 时间:2024/05/17 02:42
BOOL Search(CString str) // 这个是你传进来的,要检测的字符串
{
 
    for(int i=0; i<str.GetLength(); i++)
    {
        WCHAR h = str.GetAt(i); 
        if(  (h<0XA0B0 && h>122) || h>0xfef7 || (h>90 && h<97) ||(h>57 && h<65) || h<48) 
            return FALSE;
    }
    return TRUE;
}
0 0