fork(10) download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main()
  5. {
  6. string haystack = "''text''";
  7. string needle = "''";
  8. size_t pos;
  9. while ((pos = haystack.find(needle)) != haystack.npos)
  10. haystack.replace(pos, pos + needle.length(), "\"");
  11. cout << haystack << endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3228KB
stdin
Standard input is empty
stdout
"text"