1. 程式人生 > >如何從CString型別的字串中取出數字

如何從CString型別的字串中取出數字

LRESULT CMainDlg::OnOK(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/)
{
// TODO: Add validation code
CString strDate ="abcd(123)ff";
int nstrPos = strDate.Find(_T("("));
int nendPos = strDate.Find(_T(")"));
CString strGetDate = strDate.Mid(nstrPos+1,nendPos-nstrPos-1);
MessageBox(strGetDate);
return
0;
}