|
-
May 7th, 2003, 07:04 AM
#1
Thread Starter
Member
Find the word and count it up
Dear All
I would like to find certain Word in the TextBox and Count it up and display it.
Many Thanks for any Reply
salih
-
May 7th, 2003, 07:16 AM
#2
New Member
I have not actually tried this in .net, but in vb6 you would use the InStr command where you specify the string to search and the string to find. It returns the position as a long (variant).
Can't guarantee its available in .net as well. I have vb6 here (work) and .net at home, so can't test it
-
May 7th, 2003, 08:11 AM
#3
Lively Member
you can use IndexOf to find the first occurence of a string or charcter in another string. (lots of overloaded versions available)
Not sure what you mean by count it up? if you mean the position of the word within the string then use IndexOf, or if you mean count up every occurence then I'd use a regular expression.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|