Avatar of Laride

asked on 

Replacing with a wildcard

I keep product details in the form of an HTML string in a database field (from a content editor) and need to pull out the details into a text string with absolutely NO HTML in there in order to poulate an XML tag to send the details to an advertiser. I have successfully got this to work using the attached code but need a way of finding &xxx; and replacing. As you will see I have done this for   and ò but I want a generic way of finding anything between & and ;  and replacing with a space.  Help please.
MyNotes = VehiclesRS("Notes")
			If MyNotes <> "" Then
				MyNotesOP = ""
					StartChr = Instr(MyNotes, "<")
					EndChr = Instr(MyNotes, ">")
					MyNotesOP = MyNotesOP & Left(MyNotes, StartChr-1)
					MyNotes = Mid(MyNotes, EndChr + 1)
					If InStr(MyNotes, "<") < 1 then Exit do  
			End If
			MyNotesOP = replace(MyNotesOP,"&nbsp;"," ")  
			MyNotesOP = replace(MyNotesOP,"&ograve;"," ")

Open in new window

Scripting Languages

Avatar of undefined
Last Comment

8/22/2022 - Mon