Quickly Get The Word Count From A TextBox Control

Category:
String Manipulation
Type:
Snippets
Difficulty:
Beginning
Author:
Anonymous

Version Compatibility: Visual Basic 6, Visual Basic Script

More information:
These five lines of code take the text from a textBox control and replace duplicate spaces with single spaces. It then splits the text into an array to get the word count.

Instructions: Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code: