mirror of
https://github.com/EQEmu/Server.git
synced 2026-05-17 15:38:27 +00:00
Add to string_util.h void find_replace(std::string& string_subject, std::string& search_string, std::string& replace_string) {
This commit is contained in:
@@ -408,3 +408,10 @@ bool isAlphaNumeric(const char *text)
|
||||
return true;
|
||||
}
|
||||
|
||||
void find_replace(std::string& string_subject, std::string& search_string, std::string& replace_string) {
|
||||
auto index = string_subject.find_first_of(search_string);
|
||||
while (index != std::string::npos) {
|
||||
string_subject.replace(index, index + 1, replace_string);
|
||||
index = string_subject.find_first_of(search_string);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user