summaryrefslogtreecommitdiff
path: root/src/utils/stringutils.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-12-13 16:43:37 +0300
committerAndrei Karas <akaras@inbox.ru>2014-12-13 16:43:37 +0300
commitc6204f4b682288b882c2d035381f5bacbe5820c5 (patch)
tree8fdb1ecbf35024fa8710fd1d472a75c3f5154d5f /src/utils/stringutils.cpp
parentc7833cb8a08cf705e9e67124d746f6f7af2e93c3 (diff)
downloadmv-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.cpp10
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;
+}