Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

14 строки
369 B

  1. #pragma once
  2. std::string Replace(std::string str, const std::string& strToFind, const std::string& replaceWith) {
  3. size_t index = 0;
  4. std::string result = str;
  5. while (true) {
  6. index = result.find(strToFind, index);
  7. if (index == std::string::npos)
  8. break;
  9. result.replace(index, strToFind.size(), replaceWith);
  10. index += replaceWith.size();
  11. }
  12. return result;
  13. }