65.9K
CodeProject is changing. Read more.
Home

Don't count spaces when counting words.

starIconstarIconstarIconstarIconstarIcon

5.00/5 (2 votes)

Oct 25, 2011

CPOL
viewsIcon

8470

I also use a Regex expression to count words, which returns the same number of words as MS Word. I wrap the Regular Expression in a String extension method to make it easy to use.public static class StringExtensions{ /// /// WordCounts Regular Expression /// ...