大家好,新手刚学C#,请教下WinForms(或console)中怎么查询所输文本的信息(没有中文字符)我是在Form里建了了一个textbox,然后输入信息,通过按button在lable显示信息 string s = textBox1.Text;
string[] words = s.Split(null);
int i = words.Length;
Charcount.Text = "Total number of characters are: " + textBox1.Text.Length;
Wordscount.Text = "Total number of words are: " + i;这个是我目前写的,能在lable显示文本中有 多少字符和 多少单词,至于空格标点什么的都算进去啦,至于剩下的几个问题还完全没头绪1. 最长和最短单词?
2. 出现频率最高的单词?
3. 把所有单词按照出现频率从高到低的顺序排列?谢谢!
string[] words = s.Split(null);
int i = words.Length;
Charcount.Text = "Total number of characters are: " + textBox1.Text.Length;
Wordscount.Text = "Total number of words are: " + i;这个是我目前写的,能在lable显示文本中有 多少字符和 多少单词,至于空格标点什么的都算进去啦,至于剩下的几个问题还完全没头绪1. 最长和最短单词?
2. 出现频率最高的单词?
3. 把所有单词按照出现频率从高到低的顺序排列?谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货