std::string trim(const std::string& str)
{
size_t first = str.find_first_not_of( ' ' );
if ( std::string::npos == first ) return "";
size_t last = str.find_last_not_of( ' ' );
return str.substr( first, ( last - first + 1 ) );
}
03-21
3672
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)