How can I count number of sentences in a given string?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you already have Word installed, you can use Word interop to get the sentence count, as well as other statistics. This also has the benefit of potentially working with other languages besides English.
This will output:
This may not be the most efficient, but it only requires a few lines of code and may be suitable depending on your needs.