Am newbie here and tried the search, but not quite understood it, so I am thinking to ask to the forum for help.
I want to get the result into the text box from the following code but got an error. Confused on how to overcome it, appreciate for any help. I believe it was an error on the conversion from linqIgroup to string to be put in textboxt.Text
It's about to display the most word(s) that has been occurred in a text file.
string sentence;
string[] result = {""};
sentence = txtParagraph.Text;
char[] delimiters = new char[] { ' ', '.', '?', '!' };
string[] splitStr = sentence.Split(delimiters, StringSplitOptions.RemoveEmptyEntries);
var dic = splitStr.ToLookup(w => w.ToLowerInvariant());
var orderedDic = dic.OrderByDescending(g => g.Count(m=>m.First()).ToString()));
txtFreqWord.Text = orderedDic.ToString();
String.Joinon the dictionary'sValuesproperty, if that's what you're trying to do.