没人会吗?是否与我的bufformat的内容是汉字有关MSDN:
CString str("This is a test.");
int n = str.Remove('t');
ASSERT(n == 2);
ASSERT(str == "This is a es.");
CString str("This is a test.");
int n = str.Remove('t');
ASSERT(n == 2);
ASSERT(str == "This is a es.");
CString str("册\r\n册");
sprintf(cc, "%s", str); str.Remove('\r');
sprintf(cc, "%s", str);//cc is {78, 31, 10, 78, 78} now
//it should be {78, 31, 10, 78, 31} str.Remove('\n');
sprintf(cc, "%s", str);确实CString::Remove()在处理的时候出问题了
str.Delete(str.Find('\r'));
str.Delete(str.Find('\n'));我试过了,没问题。至于为什么会这样我也不清楚。
bufformat.Delete(str.Find('\n'));
bufformat.Delete(bufformat.Find('\n'));