make trimString more readable

This commit is contained in:
jacekpoz 2024-04-18 22:59:40 +02:00
parent 04adf4b42c
commit 0e05eee14a
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8

View file

@ -9,7 +9,7 @@
inline std::string trimString(const std::string &str) {
std::string ret(str);
ret.erase(0, ret.find_first_not_of(" \n\r\t"));
ret.erase(ret.find_last_not_of(" \n\r\t") + 1);
ret.erase(ret.find_last_not_of(" \n\r\t") + 1, std::string::npos);
return ret;
}