[Webinar] Streamline your web hosting managementRegister Today

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 711
  • Last Modified:

Top 10 most used words in a text document

How do I get the top 10 most used words in a text document ?
Any examples out their ?
0
u2envy1
Asked:
u2envy1
  • 2
2 Solutions
 
angus_young_acdcCommented:
One way would be to read each word in the document, and add it to a list.  Then do a count of how many times each word appears.
0
 
u2envy1Author Commented:
How will I do the count ? Then do a count of how many times each word appears.
If I have a list List<string> myList = new List<String>();
How do I count ?
myList.Add("The");
myList.Add("lazy");
myList.Add("Brown");
myList.Add("Fox");
myList.Add("was");
myList.Add("too");
myList.Add("lazy");
myList.Add("to");
myList.Add("jump");
myList.Add("over");
myList.Add("the");
myList.Add("brown");
myList.Add("dog");

0
 
Gautham JanardhanCommented:
u can use the grioup by function available for the list to group by the words and then check the count
0
 
u2envy1Author Commented:
Thx
0

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now