diff options
Diffstat (limited to 'tdutils/td/utils/misc.cpp')
| -rw-r--r-- | tdutils/td/utils/misc.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tdutils/td/utils/misc.cpp b/tdutils/td/utils/misc.cpp index 4d3050c60..7eab34f60 100644 --- a/tdutils/td/utils/misc.cpp +++ b/tdutils/td/utils/misc.cpp @@ -18,6 +18,14 @@ namespace td { +void replace_with_spaces(MutableSlice str, Slice characters) { + for (auto &c : str) { + if (characters.find(c) != Slice::npos) { + c = ' '; + } + } +} + char *str_dup(Slice str) { auto *res = static_cast<char *>(std::malloc(str.size() + 1)); if (res == nullptr) { |
