/ Published in: C#
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; }