Click to See Complete Forum and Search --> : Find and replace......


ant
July 5th, 2001, 07:50 PM
I know how to search a richtextbox. but when it finds the string that it's searching for, how do you make it replace that string with a "p"?

--Ant
--------------------------------------------------
check out my newest freeware
E-mail me at: christopherfolger@hotmail.com
for the address

Tower
July 5th, 2001, 09:47 PM
RichTextBox1.Text = Replace(RichTextBox1.Text, strFindString, strReplaceString)

John G Duffy
July 6th, 2001, 07:44 AM
In addition to Towers response, the RichTextBox has a "Find" method that go's something like this:

Richtextbox1.Find(string,start,end,options)



GO to MSDN Help and search for "Find Method". It will explain the parameters in detail.
It is a little more selective in what it searches

John G