VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

Count spaces or occurances of words or anything with one simple line of code

_+Seanp2k+_  (2 Submissions)   Coding Standards   Visual Basic 5.0   Beginner   Wed 3rd February 2021

Count spaces or occurances of words or anything with one simple line of code.

Inputs
text1.text would be the string you want to count the occurances in. this particular code would count how amny times "hi" appears in text1.text a common use of this to count both lower and uppercase would to first use the line text1.text = Lcase(text1.text) to make text1 all lower case. you coudl aslo use this searchtextbox.text = lcase(searchtextbox.text) occuranceslabel.caption= ubound(split(document.text, searchtextbox.text)) that would put in occuranceslabel the number of times that the text in searchtextbox appears in the document textbox.

Rate Count spaces or occurances of words or anything with one simple line of code (5(5 Vote))
Count spaces or occurances of words or anything with one simple line of code.bas

Count spaces or occurances of words or anything with one simple line of code Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters