在一段字符串中删除固定的一段,得出结果? VC 在一段字符串中删除固定的一段,得出结果"? VCC:\\windows\\system32\\ctfmon.exe 这是一段字符串。我想删去\\system32\\ctfmon.exe ,急求代码?? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString strFilepath = "C:\\windows\\system32\\ctfmon.exe";CString str = strFilepath.Left(strFilepath.Find("\\system32\\ctfmon.exe"));str就是你需要的 C:\dosh\ghos\Ghostexp.exe "%1"这是一段,我想去除\ghos\Ghostexp.exe "%1" 怎么写代码啊? CString strFilepath = "C:\\dosh\\ghos\\Ghostexp.exe \"%1\"";CString str = strFilepath.Left(strFilepath.Find("\\\ghos\\Ghostexp.exe \"%1\"")); 或者直接找第二个\:CString strFilepath = "C:\\dosh\\ghos\\Ghostexp.exe \"%1\"";int Index = 0;for(int i=0; i<2; i++)Index=strFilepath.Find(Index,'\\');CString str = strFilepath.Left(Index); 我写的程序,总是会莫名的崩溃该如何解决? 怎么检查一个指针是否有效? Tree 控件如何支持按Ctrl能够多选 关于msdn的一个 最小化窗口的例子 如何系统盘盘符?请不吝指教! 一个关于C++ Socket编程的问题 ListCtrl能否动态改变大小? 怎样取出CComboBox的值, 如何捕捉键盘击键(100分)? 用kalman对遮挡目标进行预测时,为什么跟踪框不动了? 多文档 如何同时打开并显示多个图像 VC++ EXE与DLL之间的参数传递问题
CString str = strFilepath.Left(strFilepath.Find("\\system32\\ctfmon.exe"));
str就是你需要的
CString str = strFilepath.Left(strFilepath.Find("\\\ghos\\Ghostexp.exe \"%1\""));
int Index = 0;
for(int i=0; i<2; i++)
Index=strFilepath.Find(Index,'\\');
CString str = strFilepath.Left(Index);