去掉左边 white-space:https://cplusplus.com/reference/cctype/isspace/?kw=isspace
| 44 | |
| 45 | // 去掉左边 white-space:https://cplusplus.com/reference/cctype/isspace/?kw=isspace |
| 46 | void trimLeftTrailingSpaces(string &input) { |
| 47 | input.erase(input.begin(), find_if(input.begin(), input.end(), [](int ch) { |
| 48 | return !isspace(ch); |
| 49 | })); |
| 50 | } |
| 51 | |
| 52 | // base 从其 reverse_iterator还原基础迭代器,因为 earse 参数只能是基础迭代器 |
| 53 | void trimRightTrailingSpaces(string &input) { |
no outgoing calls
no test coverage detected