Click here to Skip to main content
15,850,751 members
Articles / General Programming / Regular Expressions

Don't count spaces when counting words.

Rate me:
Please Sign up or sign in to vote.
4.86/5 (24 votes)
17 Oct 2011CPOL 78K   20  
Over the last couple of days I've seen numerous examples of people posting about how to count words in a sentence. Disturbingly, these postings recommend suggest counting the number of spaces in the sentence and use that as the basis of a word count.You may be asking why this is a problem. Well,...

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
CEO
United Kingdom United Kingdom
A developer for over 30 years, I've been lucky enough to write articles and applications for Code Project as well as the Intel Ultimate Coder - Going Perceptual challenge. I live in the North East of England with 2 wonderful daughters and a wonderful wife.

I am not the Stig, but I do wish I had Lotus Tuned Suspension.

Comments and Discussions