unicode下CString提取判断中文。英文字符。及数字

本文介绍了一种从字符串中提取特定字符的方法,包括数字、英文及中文字符,并通过循环遍历字符串实现。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

<span style="white-space: pre; background-color: rgb(255, 255, 0);">		</span><span style="background-color: rgb(255, 255, 0);">CString strRet = _T("");
			for (int i = 0; i<str22.GetLength(); i++)
			{
				if (str22.GetAt(i) >= '0'&&str22.GetAt(i) <= '9' || str22.GetAt(i) >= 'a'&&str22.GetAt(i) <= 'z' || str22.GetAt(i) >= 'A'&&st</span><span style="white-space: pre; background-color: rgb(255, 255, 0);">		</span><span style="background-color: rgb(255, 255, 0);">r22.GetAt(i) <= 'Z')</span><span style="background-color: rgb(51, 255, 51);">//提取数字英文</span><span style="background-color: rgb(255, 255, 0);">
					strRet += str22.GetAt(i);
				else if (str22.GetAt(i) >= 0x4e00 && str22.GetAt(i) <= 0x9fa5)</span><span style="background-color: rgb(51, 255, 51);">//提取中文字符</span><span style="background-color: rgb(255, 255, 0);">
				{
					strRet += str22.GetAt(i);
				}
				else continue;
			}
			str22 = strRet;</span>



unicode 字符范围链接http://blog.youkuaiyun.com/error/404.html?from=http%3a%2f%2fblog.youkuaiyun.com%2fxla9071352%2farticle%2fdetails%2f52336162

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值