title: Replace square brackets in C#
body: <p>There is a string which is innerHTML of an HTML page. In that, there are contents ...which I need to replace part by parts...I have replaced a few by the following formula.</p>
  <pre><code>string formatted = str.replace(&quot;*&quot;, &quot;&quot;)
  </code></pre>
  <p>This will replace all * in that HTML page with blank. But I need to replace following contents to blank as well.</p>
  <p>[Issue /]</p>
  <p>[-Select- /]</p>
  <p>[    ]</p>
  <p>[Upload]</p>
  <p>[Issue /]</p>
  <p>So I used code as below:</p>
  <pre><code>str.replace(&quot;[Issue \/]&quot;, &quot;&quot;)
  str.replace(&quot;[-Select- \/]&quot;, &quot;&quot;)
  str.replace(&quot;[    ]&quot;, &quot;&quot;)
  str.replace(&quot;[Upload]&quot;, &quot;&quot;)
  str.replace(&quot;[Issue \/]&quot;, &quot;&quot;)
  </code></pre>
  <p>But I couldn't see any replaces for the contents in the HTML content for the above string.</p>
  <p>And there is an image button in the HTML. That image button also I need to replace.</p>
  <p>The HTML code of the image button is below:</p>
  <pre><code>&lt;asp:ImageButton ID=&quot;btnAddHotel&quot; runat=&quot;server&quot; ImageUrl=&quot;/Style Library/images/icon-add.gif&quot; OnClick=&quot;btnAddHotel_Click&quot; OnClientClick=&quot;return HideAllTicketValidations();&quot; /&gt;
  </code></pre>
  <p>How to replace all these strings?</p>