diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index b308a5abe..6dd11160b 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -761,3 +761,13 @@ uint32_t parseNumber(const std::string &str) i = atoi(str.c_str()); return i; } + +std::string removeToken(std::string &str, const std::string &token) +{ + int idx = str.find(token); + if (idx > 0) + str = str.substr(idx + 1); + else + str.clear(); + return str; +} |