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