S
superego
Unregistered / Unconfirmed
GUEST, unregistred user!
在网上搜索了一下,都是下面的这段代码,但没有用
void CAaaView::OnButton1()
{
// TODO: Add your control notification handler code here
CString ChargeItemName;
CString aa = "9494858受得失测试585858585888d888888888888888";
int len=0;
ChargeItemName=InterceptString(len,aa);
AfxMessageBox(ChargeItemName);
len=ChargeItemName.GetLength();
ChargeItemName=aa.Mid(len);
AfxMessageBox(ChargeItemName);
}
CString CAaaView::InterceptString(int qlen, CString strSource)
{
int len,i,y;
CString sTemp,sreturn,ceshi;
strSource.TrimLeft();strSource.TrimRight();
len=strSource.GetLength();
y=0;
sTemp=strSource.Right(len-qlen);
for(i=0;i<len;i++)
{
if(sTemp[y]<0 || sTemp[y]>255)
y=y+2;
else
y=y+1;
if(y>=26)
break;
}
ceshi.Format("%d",y);
AfxMessageBox(ceshi);
sreturn=sTemp.Left;
return sreturn;
}
void CAaaView::OnButton1()
{
// TODO: Add your control notification handler code here
CString ChargeItemName;
CString aa = "9494858受得失测试585858585888d888888888888888";
int len=0;
ChargeItemName=InterceptString(len,aa);
AfxMessageBox(ChargeItemName);
len=ChargeItemName.GetLength();
ChargeItemName=aa.Mid(len);
AfxMessageBox(ChargeItemName);
}
CString CAaaView::InterceptString(int qlen, CString strSource)
{
int len,i,y;
CString sTemp,sreturn,ceshi;
strSource.TrimLeft();strSource.TrimRight();
len=strSource.GetLength();
y=0;
sTemp=strSource.Right(len-qlen);
for(i=0;i<len;i++)
{
if(sTemp[y]<0 || sTemp[y]>255)
y=y+2;
else
y=y+1;
if(y>=26)
break;
}
ceshi.Format("%d",y);
AfxMessageBox(ceshi);
sreturn=sTemp.Left;
return sreturn;
}