is there any library function for word counting in c#..?
<p>I am wondering is there any functions in c# that helps to count number of words,sentences in a file...?</p>

<p>Now I used the following code is it efficient/error free?</p>

<pre><code>string[] words=datafromfile.Split(' ');
int numberofwords=words.GetUpperBound(0)
</code></pre>

<p>Thank you</p>
