trim from end (in place)
| 199 | |
| 200 | // trim from end (in place) |
| 201 | static inline void rtrim(std::string &s) { |
| 202 | s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { |
| 203 | return !std::isspace(ch); |
| 204 | }).base(), s.end()); |
| 205 | } |
| 206 | |
| 207 | |
| 208 | // Read the next line of input from stdin, if anything is available. |
no test coverage detected