c++ string去除左右空格

res.substr(res.find_first_not_of(' '),res.find_last_not_of(' ') + 1)

原文地址:https://www.cnblogs.com/mdumpling/p/8179218.html