c++ 去除字符串首尾的空白字符
c++ 去除字符串首尾的空白字符方法一使用find_first_not_of和find_last_not_of方法二使用正则表达式(c++11)测试测试结果方法一使用find_first_not_of和find_last_not_of/** * @brief Trimmed 去掉首尾 空格白 * @param str */void Trimmed(std::string& str) { str.erase(0, str.find_first_not_of(" \r\n\t\v\
原创
2022-04-20 20:44:01 ·
3580 阅读 ·
0 评论