summaryrefslogtreecommitdiff
path: root/lib/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/common.c')
-rw-r--r--lib/common.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/common.c b/lib/common.c
index 69cc618..597f0d5 100644
--- a/lib/common.c
+++ b/lib/common.c
@@ -261,6 +261,21 @@ const char* toCase(Case cs, char* str)
return str;
}
+
+char* replaceChars(char* string, const char* chars, const char to)
+{
+ char* p = string;
+
+ while (*p)
+ {
+ if (strchr(chars, *p))
+ *p = to;
+ p++;
+ }
+
+ return string;
+}
+
void removeChars(std::string& str, const char* ignore)
{
const char* s = str.c_str();