/ Published in: C#
![](/img/icon_sav.png?v3)
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
using System.Text.RegularExpressions; public int WordCount(string txtToCount) { string pattern = "\\w+"; int CountedWords = regex.Matches(txtToCount).Count; return CountedWords; }
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)