25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

14 satır
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. }