diff options
Diffstat (limited to 'src/utils/parsing.cpp')
-rw-r--r-- | src/utils/parsing.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/utils/parsing.cpp b/src/utils/parsing.cpp index f4f65dcb2..c3d7f00f7 100644 --- a/src/utils/parsing.cpp +++ b/src/utils/parsing.cpp @@ -258,4 +258,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; + } + } |