title: How do I escape a single quote using C# string.Replace to use in HighCharts?
body: <p>In my c# application I am using user input to fill elements in HighCharts. The issue that I am running into is when a user types <code>customer's</code> it causes the application to break unless it is escaped by typing a <kbd>\</kbd> before a <kbd>'</kbd>.</p>
  
  <p>Here is the section in the Highcharts that I am filling in with the user input:</p>
  
  <pre><code>subtitle: {
      text: '&lt;%=strDescription%&gt;'
  },
  </code></pre>
  
  <p>When adding records, instead of telling my users to type an <kbd>\</kbd> before typing a <kbd>'</kbd> I want to do this for them automatically for them when I pull it out of the database and assign it to a variable. Here is what I have tried:</p>
  
  <pre><code>strDescription = reader1.GetString(0);
  strDescription.Replace("'", "\'");
  </code></pre>
  
  <p>When I remove the slash from the user input it causes the application to break as if the string was not escaped. Note the following error:</p>
  
  <pre><code>subtitle: {
      text: 'This goal will be set once we have bench-marked the first quarter's results.'
  },
  </code></pre>
  
  <p>How do I escape the single quote properly?</p>