More classic ASP code that may help someone trying to repair a legacy system.

This little function was a nifty way to remove unneeded HTML tags from a string. Used this to clean up “screenscrapes” of reports generated in HTML before parsing the content.

' * ==============

Function RipTags(sHTML,sTagType)
	Dim iStart, sFront, sBack
	Do While inStr(1,sHTML,"<" & sTagType,1) > 0
		iStart = instr(1,sHTML,"<" & sTagType,1)
		If iStart > 0 Then
			sFront = left(sHTML,iStart-1)
			iStart = instr(iStart,sHTML,">",1)
			sBack = right(sHTML,len(sHTML)-iStart)
			sHTML = sFront & sBack
		End If
		iStart = instr(1,sHTML,"",1)
		If iStart > 0 Then 
			sFront = left(sHTML,iStart-1)
			iStart = instr(iStart,sHTML,">",1)
			sBack = right(sHTML,len(sHTML)-iStart)
			sHTML = sFront & sBack
		End If
	Loop
	RipTags = sHTML
End Function