title: Remove a list of strings from a string - C# .NET
body: <p>I have a list of stopwords that need to be removed from a string.</p>
  
  <pre><code>List&lt;string&gt; stopwordsList = stopwords.getStopWordList();
  string text = PDF.getText();
  foreach (string stopword in stopwordsList)
  {
     text = text.Replace(stopword, "");
  }
  PDF.setText(text);
  </code></pre>
  
  <p>..in debug I can see the stopwordsList is being populated correctly, but it seems like the <code>text.Replace()</code> is having no effect whatsoever.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>edit: Note I have also tried <code>text.Replace()</code> on its own, rather than <code>text = text.Replace()</code>. Neither work.</p>