>>Do you know if there is an equiv to GETWORDCOUNT in c#?
>
>Not that I know of. However, you could use one of the overloads of .Split() and split on a space. Not sure if that will do a good enough job or not - you could use regular expressions, or .Replace() along with .Split() - use replace to convert returns or line feeds to spaces, for example.
Sorry, forgot to mention that you'd then use .Length to get the length of the string.
Actually, you could probably eliminate Replace() in most cases by splitting on it.
string sampleString = "This is a sample.";
string[] items = sampleString.Split(new char[] {' ', '\r', '\n'}, StringSplitOptions.RemoveEmptyEntries);int count = items.Length;