update generator with hint stuff

This commit is contained in:
gymnast86
2026-08-02 01:25:06 -07:00
parent 631cb99208
commit 66f6942dbb
35 changed files with 2266 additions and 198 deletions
@@ -89,4 +89,20 @@ namespace randomizer::utility::str {
return std::nullopt;
}
std::string Replace(const std::string& originalStr,
const std::string& oldStr,
const std::string& replacementStr,
uint32_t count) {
std::string retStr = originalStr;
auto startPos = retStr.find(oldStr);
for (int i = 0; i < count; ++i) {
if (startPos == std::string::npos) {
return retStr;
}
retStr.replace(startPos, oldStr.length(), replacementStr);
startPos = retStr.find(oldStr, startPos + replacementStr.length());
}
return retStr;
}
}