CString strText(_T("30 30 30 30 30 37 31 33 31 31"));
strText = _T(" ") + strText;
strText.Replace(_T(" 3"), _T(""));
AfxMessageBox(strText);
strText = _T(" ") + strText;
strText.Replace(_T(" 3"), _T(""));
AfxMessageBox(strText);
解决方案 »
- 硬件ID: USB\Vid_174f&Pid_1120&Rev_0121 ,谁知道其中的Rev是什么意思?
- 求"支持手机视频监控制的DVR资料和相关SDK"(在线等)
- VS2008如何配置winXP DDK2600
- VC++程序员应该看哪些书/
- 本人创建了一个VC++程序员群
- 请问这是为什么啊?在线等
- 我想将TreeView和FormView整合在一个view界面中
- 如何让我的程序支持中文,在线等待
- 哪位老兄能提供一些关于ActiveX包容器的文章?我太想看了。
- 容器 存直线
- MFC 使用方法Webbrowser 与js多次交互出现了 mshtml.dll错误
- 对话框使用GDI+贴Png图片后被CFileDialog冲掉怎么办
char dStr[20]={0};
int n=0;
char *p=sStr+1;
while(*p)
{
dStr[n]=*p;
p+=2;
n=+;
}
string replace(string & src, string find, string replacement)
{
string dest;
int i = 0;
int len = find.length();
while(true)
{
int start = i;
i = src.find_first_of(find, i);
if(i < 0)
{
dest += src.substr(start);
break;
}
dest += src.substr(start, i - start);
dest += replacement;
i += len;
}
return dest;
}
使用:
CString str = "30 30 30 30 30 37 31 33 31 31";
str = replace(str, "3", "");
str = replace(str, " ", "");
string str = "30 30 30 30 30 37 31 33 31 31";
str = replace(str, "3", "");
str = replace(str, " ", "");
CString str = "30 30 30 30 30 37 31 33 31 31";
str = " " + str;
str.Replace(" 3", "@");
str.Remove('@');