title: Remove words in string from words in array with c#
body: <p>I need to remove words from a string based on a set of words:</p>
  
  <p>Words I want to remove: </p>
  
  <pre><code>DE DA DAS DO DOS AN NAS NO NOS EM E A AS O OS AO AOS P LDA AND
  </code></pre>
  
  <p>If I receive a string like:</p>
  
  <p><strong>EDIT:</strong> This string is already "cleaned" from any symbols</p>
  
  <pre><code>THIS IS AN AMAZING WEBSITE AND LAYOUT
  </code></pre>
  
  <p>The result should be:</p>
  
  <pre><code>THIS IS AMAZING WEBSITE LAYOUT
  </code></pre>
  
  <p>So far I have:</p>
  
  <pre><code>public static string StringWordsRemove(string stringToClean, string wordsToRemove)
  {
      string[] splitWords = wordsToRemove.Split(new Char[] { ' ' });
  
      string pattern = "";
  
      foreach (string word in splitWords)
      {
          pattern = @"\b" + word + "\b";
          stringToClean = Regex.Replace(stringToClean, pattern, "");
      }
  
      return stringToClean;
  }
  </code></pre>
  
  <p>But it's not removing the words, any idea?</p>
  
  <p>I don't know if I'm using the most eficient way to do it, maybe put the words in a array just to avoid spliting them all the time?</p>
  
  <p>Thanks</p>