title: replacing a text inside clipboard which contains html formatted string in C#
body: <p>What I want to do is to replace a part of the text inside the clipboard, but the problem is it is html formatted text and I am unable to modify its content using the below given code in C#. Any solutions?</p>
  
  <p>Steps to replicate my doing:<br></p>
  
  <p>1- copy an entry from cambridge advanced learner dictionary 4 to clipboard OR any other html formatted text to clipboard
  <br>2- Use these C# codes in a windows forms application to modify and replace text while keeping its html formatting:</p>
  
  <pre><code>private void button1_Click(object sender, EventArgs e)
          {
  
              string myStr = Clipboard.GetText(TextDataFormat.Html);
              myStr.Replace("Cambridge Advanced Learner's Dictionary - 4th Edition", "******************************");
              Clipboard.SetText(myStr,TextDataFormat.Html);
  
          }
  </code></pre>
  
  <p>But it seems that it does not work at all!</p>
  
  <p>NOTE: I want to keep the html formatting, I don't want to strip string from its html formatting.</p>
  
  <hr>
  
  <p>I used Regex and it seems to work when I use:</p>
  
  <pre><code>myStr = Regex.Replace(myStr, "Cambridge Advanced Learner's Dictionary - 4th Edition", "");
  </code></pre>
  
  <p>but when I want to use:</p>
  
  <pre><code>myStr = Regex.Replace(myStr, "Cambridge Advanced Learner's Dictionary - 4th Edition&lt;br /&gt;&lt;br /&gt;", "");
  </code></pre>
  
  <p>it does not work! any solutions to remove those html tags: <code>&lt;br /&gt;&lt;br /&gt;</code>
  ?</p>