remove stopword from a String in asp.net c# -


i having trouble creating code removes stop words string. here code:

string review="the portfolio fine except fact last movement of sonata #6 missing. should 1 expect?";  string[] arrstopword = new string[] {"a", "i", "it", "am", "at", "on", "in", "to", "too", "very","of", "from", "here", "even", "the", "but", "and", "is","my","them", "then", "this", "that", "than", "though", "so", "are"}; stringbuilder sbreview = new stringbuilder(review); foreach (string word in arrstopword){ sbreview.replace(word, "");} label1.text = sbreview.tostring(); 

when running label1.text = "the portfolo s fne except fct tht lst movement st #6 s mssng. wht should e expect? "

i expect must return "portofolio fine except fact last movement sonata #6 missing. should 1 expect?"

anybody know how solve this?

you use " ", " ", etc make sure program removes words if they're used word (so spaces around them). replace them space keep formatting is.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

android - CollapsingToolbarLayout: position the ExpandedText programmatically -

Listeners to visualise results of load test in JMeter -