trim white spaces from the left end of an input string
| 724 | |
| 725 | // trim white spaces from the left end of an input string |
| 726 | static std::string trim_left(const std::string &input_string) { |
| 727 | std::string result = input_string; |
| 728 | result.erase(result.begin(), std::find_if(result.begin(), result.end(), |
| 729 | [](int ch) { return !std::isspace(ch); })); |
| 730 | return result; |
| 731 | } |
| 732 | |
| 733 | // trim white spaces from right end of an input string |
| 734 | static std::string trim_right(const std::string &input_string) { |