mirror of
https://git.mirrors.martin98.com/https://github.com/SoftFever/OrcaSlicer.git
synced 2025-08-14 03:46:07 +08:00
Merge branch 'main' into feature/universal_mac
This commit is contained in:
commit
b66aff84de
@ -39,7 +39,10 @@ std::set<std::string> SplitStringAndRemoveDuplicateElement(const std::string &st
|
|||||||
void ReplaceString(std::string &resource_str, const std::string &old_str, const std::string &new_str)
|
void ReplaceString(std::string &resource_str, const std::string &old_str, const std::string &new_str)
|
||||||
{
|
{
|
||||||
std::string::size_type pos = 0;
|
std::string::size_type pos = 0;
|
||||||
while ((pos = resource_str.find(old_str)) != std::string::npos) { resource_str.replace(pos, old_str.length(), new_str); }
|
while ((pos = resource_str.find(old_str, pos)) != std::string::npos) {
|
||||||
|
resource_str.replace(pos, old_str.length(), new_str);
|
||||||
|
pos += new_str.length(); //advance position to continue after replacement
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user