首页 > 代码库 > 判断CString字符串中各位是数字,大小写字母,符号,汉字.xml

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

<style type="text/css"> pre{ line-height:1; color:#1e1e1e; background-color:#e9e9ff; font-size:16px;}.sysFunc{color:#627cf6;font-style:italic;font-weight:bold;} .selfFuc{color:#800080;} .bool{color:#d2576f;} .condition{color:#000080;font-weight:bold;} .key{color:#000080;} .var{color:#800000;font-style:italic;} .Digit{color:#ff00ff;font-weight:bold;} .includePre{color:#1e1e1e;} .operator?{color:#008000;font-weight:bold;} </style>

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