我有一个需要从字符串中删除的停用词表的列表。从字符串中删除字符串列表 - C#.NET
List<string> stopwordsList = stopwords.getStopWordList();
string text = PDF.getText();
foreach (string stopword in stopwordsList)
{
text = text.Replace(stopword, "");
}
PDF.setText(text);
..in调试我可以看到stopwordsList被正确填充,但它似乎像text.Replace()
是有没有任何效果。
我在做什么错?
编辑:注意我也试过text.Replace()
本身,而不是text = text.Replace()
。既没有工作。
什么是gettext的函数的返回? – Max
无法重现您的问题。 – ken2k
您是否调试过它并检查foreach循环的每次迭代中的停用词?我很确定这些都是不正确的,因为否则代码看起来很好。 – Tobberoth