mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 01:11:29 +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:
parent
a6b95aeceb
commit
ed9bdaf60c
@ -408,3 +408,10 @@ bool isAlphaNumeric(const char *text)
|
|||||||
return true;
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -56,4 +56,6 @@ std::vector<std::string> SplitString(const std::string &s, char delim);
|
|||||||
|
|
||||||
bool isAlphaNumeric(const char *text);
|
bool isAlphaNumeric(const char *text);
|
||||||
|
|
||||||
|
void find_replace(std::string& string_subject, std::string& search_string, std::string& replace_string);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user