?????????????????????

解决方案 »

  1.   

    CString str;
    str.Remove(' ');
      

  2.   

    CString::Remove
    int CString::Remove( TCHAR ch );Return ValueThe count of characters removed from the string. Zero if the string isn't changed.ParameterschThe character to be removed from a string.ResCall this member function to remove instances of ch from the string. Comparisons for the character are case-sensitive.Example//remove the lower-case letter 't' from a sentence:CString str("This is a test.");
    int n = str.Remove('t');
    ASSERT(n == 2);
    ASSERT(str == "This is a es.");
      

  3.   

    CString strBang("Everybody likes ice hockey");
    n = strBang.Replace(" ", NULL);
      

  4.   

    上面的老大已经说的够详细了。
    补充一下,要去掉边上的空格就用:str.TrimRight();str.TrimLeft();