title: Replace double quotes with empty string using Regex c#
body: <p>I have the following: </p>
  
  <pre><code>this.LocationCode = this.LocationCode.Replace(@"""", String.Empty);
  </code></pre>
  
  <p>However I would like to use regex instead. I've used the next block of code but it doesn't do anything to the string. (They are in seperate classes but I've put them all together here for convenience)</p>
  
  <pre><code>public const string checkStringForDoubleQuotes = @"^[""]$";
  Regex doubleQuotesPattern = new Regex(RegexChecks.checkStringForDoubleQuotes);
  this.LocationCode = Regex.Replace(this.LocationCode, doubleQuotesPattern.ToString(), "");
  </code></pre>
  
  <p>Can anyone see where I'm going wrong?
  When LocationCode comes through it contains "K\"23". When I use the string replace it produces "K23" which is perfect, but the Regex way just leaves the value as it is.</p>
  
  <p><strong>SOLUTION</strong> </p>
  
  <p>After tinkering around a little more I now have the following:</p>
  
  <pre><code>public const string checkStringForDoubleQuotes = @"["" ,]";
  Regex doubleQuotesPattern = new Regex(RegexChecks.checkStringForDoubleQuotes )
  this.LocationCode = doubleQuotesPattern.Replace(this.LocationCode, "");
  </code></pre>
  
  <p>This has allowed me to add more criteria (the comma ,) into the regex string which I wanted the option to do but realised I hadn't added that part in my question, sorry! This way is acceptable for the project, so thanks to all who helped out.</p>