title: Replace backward slashes with forwards slashes or double backward slashes in C++
body: <p>So I have a string:</p>
  
  <pre><code>string path = "C:\Users\Richard\Documents\Visual Studio 2010\Projects\Client\Debug";
  </code></pre>
  
  <p>I want to replace all backward slashes in it with forward ones so it looks like:</p>
  
  <pre><code>C:/Users/Richard/Documents/Visual Studio 2010/Projects/Client/Debug
  </code></pre>
  
  <p>This does not work:</p>
  
  <pre><code>string toReplace = "\\";
  path.replace(path.find(toReplace), toReplace.length(), "/");
  </code></pre>
  
  <p>Obviously, \ is an escape character so that is probably causing the problem.</p>