diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-02-28 22:09:45 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-02-28 22:09:45 +0300 |
commit | cd0883a1704c1b514b8b7317358949d43e230644 (patch) | |
tree | 08a0334c32dd61993e4557c34627a67b01313b36 /src/utils/stringutils.cpp | |
parent | 3d944b6d5ee981464f6eea4e9034d5aeb7b9423a (diff) | |
download | ManaVerse-cd0883a1704c1b514b8b7317358949d43e230644.tar.gz ManaVerse-cd0883a1704c1b514b8b7317358949d43e230644.tar.bz2 ManaVerse-cd0883a1704c1b514b8b7317358949d43e230644.tar.xz ManaVerse-cd0883a1704c1b514b8b7317358949d43e230644.zip |
Add function for add quotes and escape in text quotes.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index b2ac25875..66f61f168 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -996,6 +996,12 @@ std::string timeDiffToString(int timeDiff) return str; } +std::string escapeString(std::string str) +{ + replaceAll(str, "\"", "\\\""); + return "\"" + str + "\""; +} + #ifndef DYECMD void replaceItemLinks(std::string &msg) { |