上面的代码是去处edit中的所有的汉字!
来源:互联网 发布:淘宝头条能做淘客吗 编辑:程序博客网 时间:2024/04/30 13:27
void CHanZiDlg::ParseCharacter( const char *str,CString *pstrResult)
{
int len=strlen(str);
const char *pch=str;
*pstrResult= " ";
for(int index=0;index <len;index++)
{
if((*pch&128))//,高位为1,发现汉字,去除掉!
pch++;
else
*pstrResult+=*pch++;
}
}
void CHanZiDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString str;
CString strResult;
this-> m_EditCtrl.GetWindowText(str);
this-> ParseCharacter((LPCSTR)str,&strResult);
MessageBox(strResult);
}
----------------
上面的代码是去处edit中的所有的汉字!
你可以改一下呀!
实际上汉字的高位是1,
{
int len=strlen(str);
const char *pch=str;
*pstrResult= " ";
for(int index=0;index <len;index++)
{
if((*pch&128))//,高位为1,发现汉字,去除掉!
pch++;
else
*pstrResult+=*pch++;
}
}
void CHanZiDlg::OnButton2()
{
// TODO: Add your control notification handler code here
CString str;
CString strResult;
this-> m_EditCtrl.GetWindowText(str);
this-> ParseCharacter((LPCSTR)str,&strResult);
MessageBox(strResult);
}
----------------
上面的代码是去处edit中的所有的汉字!
你可以改一下呀!
实际上汉字的高位是1,
- 上面的代码是去处edit中的所有的汉字!
- 会议是浪费工作时间的最佳去处
- 会议是浪费工作时间的最佳去处
- 会议是浪费工作时间的最佳去处
- 绍兴的确是一个不错的去处
- 会议是浪费工作时间的最佳去处
- edit编辑框 判断输入的字符是汉字还是英文
- 打印所有的汉字
- 汉字在url上面的传递
- 汉字在url上面的传递
- 【转载】会议是浪费工作时间的最佳去处
- 20170405 杭州是个生活的好去处
- java获取中文汉字的所有拼音代码分享
- 学习.net的去处
- 去处HTML的函数
- 关于5.1的去处
- 我们的去处
- 下载的好去处
- ZendFramework中application.ini配置
- 测试
- 泛型通配符和自定义T类型的区别
- ural 1056 computer net
- POJ 2063 Investment (完全背包)
- 上面的代码是去处edit中的所有的汉字!
- js 滚动图片
- linux内核杂项设备驱动源码分析
- C/C++表达式求值(参考后自己的一些理解)
- C++面试题
- 博客
- 今天intel面试总结
- Ubuntu下安装JDK
- 金山卫士界面库界面编辑器效果图