diff options
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index 6a88a12e..2f9bc9a8 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -61,3 +61,16 @@ const char *ipToString(int address) return asciiIP; } + +std::string &removeBadChars(std::string &str) +{ + std::string::size_type pos; + do + { + pos = str.find_first_of("@#[]"); + if (pos != std::string::npos) + str.erase(pos, 1); + } while (pos != std::string::npos); + + return str; +} |