How do I find the same word in a richTextBox, but at different locations. E.g: I need to find the word computer in the first paragraph and again in the second paragraph.

Re: Windows Forms General Finding the same word twice


Normaly in a find string function you can specify the position to start searching. When you find the first instance of the word, the find the next word start looking from the position of the last word + 1

pos = 0

do while words are found

pos = text.FindString(pos, word to find)

pos += 1