how do I search a string for "dimava", and if it finds it, replace dimava with "He". (without quotation marks for both)
thanks
~~~Dimava~~~
Printable View
how do I search a string for "dimava", and if it finds it, replace dimava with "He". (without quotation marks for both)
thanks
~~~Dimava~~~
Code:strFind = Chr(34) & "dimava" & Chr(34)
strReplace = Chr(34) & "He" & Chr(34)
Text1.Text = Replace(Text1.Text,strFind,strReplace)
Quote:
Originally posted by crptcblade
Code:strFind = Chr(34) & "dimava" & Chr(34)
strReplace = Chr(34) & "He" & Chr(34)
Text1.Text = Replace(Text1.Text,strFind,strReplace)
I believe, as we Americans do, we quote stuff that we are refering to, pretty much.
So it'd just be like this:
Code:Private Sub Command1_Click()
Text1.Text = Replace(Text1.Text, "dimava", "He")
End Sub
Doh, I read it too quick...I thought it said with quotations...sorry about that...:rolleyes:
crptcblade: thanks for the code
matt: thanks, but i figured it out