码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2014-10-18 00:41:50      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:style   http   color   io   os   ar   使用   for   sp   

????//?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);????
?????}????
????}????

本文使用?书画小说软件?发布,内容与软件无关,书画小说软件?更惬意的读、更舒心的写、更轻松的发布。

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

标签:style   http   color   io   os   ar   使用   for   sp   

原文地址:http://www.cnblogs.com/shuilan0066/p/4032293.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!