title: VB - Replace Function and escaping a quote
body: <p>I appreciate there are a lot of similar posts on here which I have read with interest, but I just can't find the solution for my particular issue, hope someone can help.</p>
  
  <p><code>strFieldValue</code> is a string (a title) which may contain quotes e.g. someone may put text like 9" (9 inch) - this causes issues for the code following this. So I wanted to search the string for the quote(s) and replace with escaped quotes.  So far I have only managed to remove the quote altogether.</p>
  
  <p>What I have tried -</p>
  
  <p><code>newFieldValue = Replace(strFieldValue,Chr(34), "")</code> - this removed the quote</p>
  
  <p><code>newFieldValue = Replace(strFieldValue,Chr(34), """"")</code> - I thought this would work as the double quotes would escape the one in the middle, but all it did was print all 5 quotes in my debug</p>
  
  <p>Is there a way to make any quotes in the string 'safe' but still exist?</p>
  
  <p>Many thanks
  Lisa</p>
  
  <p>The data passed to the JSON scripts, which contains the offending string:</p>
  
  <p>{"request":{},"results":[{"columns":[{"dbname":"REFERENCE","text":"Reference"},{"dbname":"VERSION","text":"Version"},{"dbname":"TITLE","text":"Title"},{"dbname":"AUTHOR","text":"Author"},{"dbname":"STATE","text":"State"}],"rows":[{"id":"6422","REFERENCE":"TPJ/TECH/DES/406","VERSION":"v1A","TITLE":"Doc Baselines Test lisa % &amp;&amp; /","AUTHOR":"LISA CARVER","STATE":"Filed"}]}]}  </p>
  
  <p>{"request":{},"results":[{"columns":[{"dbname":"REFERENCE","text":"Reference"},{"dbname":"VERSION","text":"Version"},{"dbname":"TITLE","text":"Title"},{"dbname":"AUTHOR","text":"Author"},{"dbname":"STATE","text":"State"}],"rows":[{"id":"6422","REFERENCE":"TPJ/TECH/DES/406","VERSION":"v1A","TITLE":"Doc Baselines Test lisa" % &amp;&amp; /","AUTHOR":"LISA CARVER","STATE":"Filed"}]}]}  </p>
  
  <p>The latter one is cutting the string short with the quote.</p>