TrimRight
CString oo = _T("uu_Tempe_code");
oo.TrimLeft(_T("uu_"));
oo.TrimRight(_T("_code"));
运行发现oo = Temp,为什么少个e?
[解决办法]
CString oo = _T("uu_Tempe_coda");
改成这样试试,就是把最后一个字母的e改成除Temp外的任何字母,如果正常就说明这个截取函数是截取所有一样的字母,而不是截取单词
[解决办法]
理解有问题,给个例子:
CString oo = _T("ccccooooddddeeee_code");
oo.TrimRight(_T("_code"));
结果是 “” !!!!!
就是说 从串尾开始 字串中 与 “_code” 一样的 全 删除。
Use the versions of this function that accept parameters to remove a particular character or a particular group of characters from the end of a string.
同样:
oo.TrimLeft(_T("_code"));
结果也是 “”
Use the versions of this function that accept parameters to remove a particular character or a particular group of characters from the beginning of a string.