By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,098 Members | 1,950 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,098 IT Pros & Developers. It's quick & easy.

probleum in searching a word multiple time in a single file

P: 198
i made program on searching and if a word is present in a file more than one time this program search it one time and exit the file but i want to show all the locations of the searched word in single file
for single search i use the coding
Dim contents As String = objStreamReader.ReadToEnd()
txtfile.SelectionStart = InStr(txtfile.Text, "apend")
s = contents.Substring(txtfile.SelectionStart - 1, 10)

how i can modify the above program so that it search the word on all locations

thanks in advance
Jun 17 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 5K+
P: 7,872
Use the correct function of strings .indexOf() and give it a start index that is a value AFTER the previous index.
Jun 17 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.