diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-12-13 16:43:37 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-12-13 16:43:37 +0300 |
commit | c6204f4b682288b882c2d035381f5bacbe5820c5 (patch) | |
tree | 8fdb1ecbf35024fa8710fd1d472a75c3f5154d5f /src/utils/stringutils.cpp | |
parent | c7833cb8a08cf705e9e67124d746f6f7af2e93c3 (diff) | |
download | mv-c6204f4b682288b882c2d035381f5bacbe5820c5.tar.gz mv-c6204f4b682288b882c2d035381f5bacbe5820c5.tar.bz2 mv-c6204f4b682288b882c2d035381f5bacbe5820c5.tar.xz mv-c6204f4b682288b882c2d035381f5bacbe5820c5.zip |
Improve /invtostorage chat command.
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; +} |