Results 1 to 4 of 4

Thread: Bestway to determine number of words in a text box...

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27

    Bestway to determine number of words in a text box...

    Any help would be greatful.

    Thanks.
    Last edited by thegenesi; Mar 31st, 2003 at 09:08 PM.

  2. #2
    PowerPoster hellswraith's Avatar
    Join Date
    Jul 2002
    Location
    Washington St.
    Posts
    2,464
    Store the text in a string, split the string using a space as the delimiter, the resulting array count will be how many words are in the textbox.

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Feb 2003
    Posts
    27
    Thank you,

    Perhaps could you give an example?

  4. #4
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    You can use RegularExpressions too.

    VB Code:
    1. Dim r As New System.Text.RegularExpressions.Regex("\W+")
    2.         Me.Text = r.Matches(TextBox1.Text, "\W+").Count + 1

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width