This commit is contained in:
2024-10-17 16:49:05 -05:00
parent 184288ce24
commit cf6a611fae
16 changed files with 347 additions and 119 deletions

View File

@@ -9,6 +9,15 @@
#include <iterator>
#include <algorithm>
std::string replace(std::string subject, const std::string& search, const std::string& replace) {
size_t pos = 0;
while ((pos = subject.find(search, pos)) != std::string::npos) {
subject.replace(pos, search.length(), replace);
pos += replace.length();
}
return subject;
}
template <typename Out>
void split(const std::string &s, char delim, Out result, int limit) {
int it = 0;