title: How to convert string to HTML safe string
body: <p>I am creating a some dynamically generated HTML</p>
  
  <pre><code>bldr.AppendLine("&lt;a&gt;");
  string userText = user.Company;
  bldr.AppendLine(userText);
  bldr.AppendLine("&lt;/a&gt;");
  </code></pre>
  
  <p>How can I ensure that whatever the company's name is, will appear as it should, but also if they try to inject any HTML in thier name it will simply appear in plain text.</p>
  
  <p>For instance if they tried to use the name "<code>&lt;script&gt;alert("Do Bad!")&lt;/script&gt;</code>" that's exactly what will appear on the page, in plain text.</p>
  
  <p>But I also want to avoid "A &amp; C" translating to "A \u0026 C", which is what happens when I use</p>
  
  <pre><code>HttpUtility.JavaScriptStringEncode(user.Company);
  </code></pre>