Starting from the right, trim the character.
| 127 | |
| 128 | // Starting from the right, trim the character. |
| 129 | inline std::string RightTrim(std::string str, char c) |
| 130 | { |
| 131 | const auto it = std::find_if(str.rbegin(), str.rend(), [&c](char ch) { return c!=ch; }); |
| 132 | str.erase(it.base(), str.end()); |
| 133 | return str; |
| 134 | } |
| 135 | |
| 136 | // Starting from the right, trim all the space characters i.e. space, tabulation, etc. |
| 137 | inline std::string RightTrim(std::string str) |