TCHAR szSkipedChars[] = TEXT("/x3000 /t");
tstring strCurDomain = TEXT(" /t abcd ");
strCurDomain.erase(0, strCurDomain.find_first_not_of(szSkipedChars));
strCurDomain.erase(strCurDomain.find_last_not_of(szSkipedChars) + 1);
其它定义:
#ifdef UNICODE
#define tstring std::wstring
#else
#define tstring std::string
#endif
另外请注意字符串szSkipedChars, 其中的/x3000(即数字0x3000)是汉语的空格,也就是全角空格,相当于一个汉字,但你又看不见它.