c/c++常用代码--string trim

 

typedef std::basic_string<TCHAR> tstring;

 

inline static void trim(tstring& s)
{
    s.erase(0, s.find_first_not_of(_T("\r\t\n ")));
    s.erase(s.find_last_not_of(_T("\r\t\n "))+1);
}

posted @ 2014-09-28 13:06  崇山峻岭  阅读(248)  评论(0编辑  收藏  举报