title: Replace specific text while ignoring spaces
body: <p>I need to replace text in C# while ignoring any spaces.</p>
  
  <p>For example:</p>
  
  <pre><code>"This is a text with some tags &lt;UL&gt; &lt;P&gt; &lt;LI&gt;", 
  "This is a text with some tags &lt;UL&gt;   &lt;P&gt;    &lt;LI&gt;", 
  "This is a text with some tags &lt;UL&gt;&lt;P&gt;    &lt;LI&gt;" or 
  "This is a text with some tags &lt;UL&gt;&lt;P&gt;&lt;LI&gt;"
  </code></pre>
  
  <p>must all be replaced with</p>
  
  <pre><code>"This is a text with some tags &lt;UL&gt;&lt;LI&gt;"
  </code></pre>
  
  <p>Note that I just cannot remove spaces from the whole string and then replace the required string, since that would give a wrong result - </p>
  
  <pre><code>"Thisisatextwithsometags&lt;UL&gt;&lt;LI&gt;"
  </code></pre>
  
  <p>I am sure that the 3 tags </p>
  
  <pre><code>"&lt;UL&gt;", "&lt;P&gt;" and "&lt;LI&gt;"
  </code></pre>
  
  <p>will be present in that order, but am not sure of the spaces between them.</p>