IMO, Regular expressions are the best for you. Here is a sample code.
Dim objRegExp
Set objRegExp=Server.CreateObject("VBScript.RegExp")
objRegExp.IgnoreCase=true
objRegExp.Global=True
objRegExp.Pattern="\brar\b" ' matches the complete word rar
Response.Write(objRegExp.Replace(strYourString, "<a href=""http://www.link.com"">rar</a>"))
----------------------------------------------------------------------
strYourString is the string taken from db (the one in which the word rar is to be replaced).
PS: The above code is intended to give you a guideline. It is not tested.
|