Hi every body
I have a textbox on my form and i want to know how many words i have writen in it.
the idea >> i thought if i declared ( x as string and x =" ") now x equal one space if i can count how many spaces in the textbox i will know how many words in textbox by adding 1 to result of x .
this is my idea but finally any method will help.
by the way if there are any file *.pdf teatch me functions(trim,len.....) i will be thankful.
Recommended Answers
Jump to PostYes, try writing your idea on paper. You would be using looking for spaces, but not just single spaces because words can be separated by more than one space.
Also watch out for tabs etc.
Jump to PostTry this:
Dim x As Integer = System.Text.RegularExpressions.Regex.Matches(TextBox1.Text, "\w+").Count()
All 8 Replies
iamthwee
arjunsasidharan
297
Practically a Posting Shark
iamthwee
commented:
Won't work...
-2
iamthwee
arjunsasidharan
commented:
your link didn help him i guess :p
+0
caesarmx
-3
Newbie Poster
iamthwee
waynespangler
63
Posting Pro in Training
iamthwee
commented:
Another good alternative.
+9
arjunsasidharan
commented:
You are really good in when it comes to search a code
+2
caesarmx
-3
Newbie Poster
Rashakil Fol
commented:
This font again...
-2
waynespangler
63
Posting Pro in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.