16,471
社区成员
发帖
与我相关
我的任务
分享
void FormString(CString& strText, const int TOKEN)
{
int nLen = strText.GetLength();
if(nLen < TOKEN)
{
return ;
}
CString strTmp(_T(""));
int nIndex = nLen;
while(nIndex > 0)
{
strText.Insert(nIndex, _T(","));
nIndex -= TOKEN;
}
AfxMessageBox(strText);
}
// 调用方法
#define MAX_TOKEN 3
CString strText = _T("1234567890");
FormString(strText, MAX_TOKEN);