16,551
社区成员
发帖
与我相关
我的任务
分享
CString str ="a44bc123阿萨德【】[]";
int nLastWord = 10;
int i=str.GetLength() - 1;
CString sResult;
while(i >= 0 && nLastWord > 0)
{
if(str[i]>=0xa0)//全角,中文
{
sResult+=str[i];
sResult+=str[i - 1];
i = i - 2;
}
else//半角,英文
{
sResult+=str[i];
i --;
}
nLastWord -- ;
}
CString sNewstr;
for(i =0;i < sResult.GetLength();i ++)
sNewstr += sResult[sResult.GetLength() - 1 -i];