diff options
Diffstat (limited to '')
-rw-r--r-- | source/StringUtils.cpp | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/source/StringUtils.cpp b/source/StringUtils.cpp index 2bb6ae76e..403b10a7c 100644 --- a/source/StringUtils.cpp +++ b/source/StringUtils.cpp @@ -594,8 +594,8 @@ AString EscapeString(const AString & a_Message) last = i + 1; break; } - } - } + } // switch (ch) + } // for i - a_Message[] if (len > last) { EscapedMsg.append(a_Message, last, len - last); @@ -606,3 +606,22 @@ AString EscapeString(const AString & a_Message) + +AString StripColorCodes(const AString & a_Message) +{ + AString res(a_Message); + size_t idx = 0; + while (true) + { + idx = res.find("\xc2\xa7", idx); + if (idx == AString::npos) + { + return res; + } + res.erase(idx, 3); + } +} + + + + |