Am I missing something here ? XD TrimRight does not seem to want to work
Ok, here is the small portion of开发者_JAVA技巧 code to demonstrate:
CString txt = _T("Hello World");
CString txt2 = txt;
txt2.TrimRight('W');
AfxMessageBox(txt2);
The output is "Hello World".
What am I not getting right ?
The call txt2.TrimRight('W');
removes all characters 'W' from the right side of the string. Since "Hello World" does not end in 'W' nothing is trimmed at all.
精彩评论