rename
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user