title: How to replace one char by another using std::string in C++?
body: <p>How to replace one char by another using <code>std::string</code> in C++? In my case, I'm trying to replace each <code>c</code> character by <code></code> character.</p>
  
  <p>I've tried this way :</p>
  
  <pre><code>std::string str = "abcccccd";
  str = str.replace('c', ' ');
  </code></pre>
  
  <p>But, this wouldn't work.</p>