| 128 | } |
| 129 | |
| 130 | std::string TrimString(const std::string& str, const std::string& whitespaces) { |
| 131 | const auto strBegin = str.find_first_not_of(whitespaces); |
| 132 | if (strBegin == std::string::npos) return ""; // no content |
| 133 | |
| 134 | const auto strEnd = str.find_last_not_of(whitespaces); |
| 135 | const auto strRange = strEnd - strBegin + 1; |
| 136 | |
| 137 | return str.substr(strBegin, strRange); |
| 138 | } |
| 139 | |
| 140 | std::string TrimSurroundingWhitespace(const std::string& str, const std::string& whitespaces) { |
| 141 | std::string s = str; |