CString strText(_T("30 30 30 30 30 37 31 33 31 31"));
strText = _T(" ") + strText;
strText.Replace(_T(" 3"), _T(""));
AfxMessageBox(strText);

解决方案 »

  1.   

    http://www.cppblog.com/wrhwww/archive/2009/05/22/85340.html 可能对楼主有用
      

  2.   

    char sStr="30 30 30 30 30 37 31 33 31 31";
    char dStr[20]={0};
    int n=0;
    char *p=sStr+1;
    while(*p)
    {
       dStr[n]=*p;
       p+=2;
       n=+;
    }
      

  3.   

    给你个函数,直接拿去用:
    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, " ", "");
      

  4.   

    使用:
    string str = "30 30 30 30 30 37 31 33 31 31";
    str               = replace(str, "3", "");
    str               = replace(str, " ", "");
      

  5.   

    代码如下:
    CString str = "30 30 30 30 30 37 31 33 31 31";
    str = " " + str;
    str.Replace(" 3", "@");
    str.Remove('@');