Ok, here is the small portion of 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 ?
Ok, here is the small portion of 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.