string 去除前后空格

void trimString(std::string & str )
{
    int s = str.find_first_not_of(" ");
    int e = str.find_last_not_of(" ");
    str = str.substr(s,e-s+1);
    return;
}

  

posted @ 2018-07-11 16:08  那一剑的風情  阅读(877)  评论(0)    收藏  举报