title: How to escape quotes with string.replace
body: <p>Not sure my brain has completely started today...  </p>
  
  <p>I would need to escape defined quotation marks (<code>"</code> or <code>'</code>) in a string provided by the user, so depending on selected char the transformation should look like follows:  </p>
  
  <p><code>"I'm not so \"stupid\", am I?"</code> => <code>"I\\'m not so \"stupid\", am I?"</code><br>
  <code>"I'm not so \"stupid\", am I?"</code> => <code>"I'm not so \\\"stupid\\\", am I?"</code></p>
  
  <p>Trying to use <code>string.Replace(string, string)</code> drives me a little bit crazy, because it still refuses to perform the desired replacements (no additional backslashes are inserted to the result). And I still refuse to do it manually via loop ;)</p>
  
  <pre><code>Dictionary&lt;Type, char&gt; qString;            // ...
  valueStr = "I'm not so \"stupid\", am I?"; // Illustation only, in reality there is some user input used
  // ...
  string escFrom = qString[type].ToString(); // Make string from the quotation mark
  string escTo   = "\\" + escFrom;           // Add the escape to it
  valueStr.Replace(escFrom, escTo);          // Try to replace it
  </code></pre>
  
  <p><strong>Could you please help me with the mentioned startup completion?</strong>  </p>
  
  <p>Is there any obvious error I'm doing and not seeing?<br>
  Is there any hack like "safe" strings or any "culture" related stuff?</p>