// 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/