aboutsummaryrefslogtreecommitdiffstats
path: root/src/utils/parsing.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/parsing.cpp')
-rw-r--r--src/utils/parsing.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/parsing.cpp b/src/utils/parsing.cpp
index 9ec00040c..25f021c8c 100644
--- a/src/utils/parsing.cpp
+++ b/src/utils/parsing.cpp
@@ -288,4 +288,17 @@ std::string ipv4_to_string(u32bit ip)
return str;
}
+std::string replace_char(const std::string& str,
+ char from_char,
+ char to_char)
+ {
+ std::string out = str;
+
+ for(size_t i = 0; i != out.size(); ++i)
+ if(out[i] == from_char)
+ out[i] = to_char;
+
+ return out;
+ }
+
}