how we can count sentances in list ?
this is my code behind the button .
int count_sentence = 0;
string sentence = textBox2.Text;
ms_word_doc = sentence.Split('.').ToList();
count_sentence=(ms_word_doc);
textBox3.Text = textBox3.Text + Environment.NewLine + "the total no of sentences is " + count_sentence.ToString();
Count sentence
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.


Vladimir Nani29 reputationPosted Apr 15, 2010, 11:39 PM EDT
int count_sentence = 0;
string sentence = textBox1.Text;
count_sentence = sentence.Split('.').ToList().Count - 1;
textBox1.Text = textBox1.Text + Environment.NewLine + "the total no of sentences is " + count_sentence.ToString();
Sam HobbsRank #107 · 20.5K reputationPosted Apr 16, 2010, 2:31 PM EDT