CString str,strChar,strResult;
GetDlgItem(IDC_EDIT1)->GetWindowText(str);
strChar = ":";
int loop = str.Find(strChar);
strResult = str.Left(loop);
AfxMessageBox(strResult);
如果一个字符串里面有多个strChar就用循环来截取!
转载于:https://www.cnblogs.com/bobosoft/archive/2008/05/22/1204698.html