VC 判断CString字符串中各位是数字,大小写字母,符号,汉字

来源:互联网 发布:js设计模式是什么 编辑:程序博客网 时间:2024/05/20 21:58
// UNICODE字符集CString str =  L"0123abc中文字符、/";  CString shuzi,biaodianfuhao,hanzi,daxiezimu,xiaoxiezimu;    for (int i = 0 ; i <str.GetLength();i++)  {   int unicode = (int)str.GetAt(i);   if (unicode <= "9" && unicode >= "0")   {    shuzi += str.GetAt(i);   }   else if (unicode <= "z" && unicode >= "a")   {    xiaoxiezimu += str.GetAt(i);   }   else if (unicode <= "Z" && unicode >= "A")   {    daxiezimu += str.GetAt(i);   }   else if (unicode > 255)   {    hanzi += str.GetAt(i);   }   else   {    biaodianfuhao += str.GetAt(i);   }  }  


转载自:

http://blog.163.com/pirates_fish/blog/static/183333150201111221034325/

原创粉丝点击