HTMLDecode – Convert an HTML string to a plain text

HTMLDecode – Convert an HTML string to a plain text

' Decode an HTML string to a regular ANSI string'' it strips down all special HTML sequences (eg "<")' however, it doesn't strip HTML tagsFunction HTMLDecode(ByVal html As String) As String    Dim i As Long        HTMLDecode = html        Do        ' search the next ampersand, exit if no more        i = InStr(i + 1, HTMLDecode, "&")        If i = 0 Then Exit Do        If StrComp(Mid$(HTMLDecode, i, 6), " ", vbTextCompare) = 0 Then           HTMLDecode = Left$(HTMLDecode, i - 1) & " " & Mid$(HTMLDecode, i + 6)        ElseIf StrComp(Mid$(HTMLDecode, i, 6), """, vbTextCompare) = 0 Then            HTMLDecode = Left$(HTMLDecode, i - 1) & """" & Mid$(HTMLDecode, _                i + 6)        ElseIf StrComp(Mid$(HTMLDecode, i, 5), "&", vbTextCompare) = 0 Then            HTMLDecode = Left$(HTMLDecode, i - 1) & "&" & Mid$(HTMLDecode, _                i + 5)        ElseIf StrComp(Mid$(HTMLDecode, i, 4), "<", vbTextCompare) = 0 Then            HTMLDecode = Left$(HTMLDecode, i - 1) & "<" & Mid$(HTMLDecode, _                i + 4)        ElseIf StrComp(Mid$(HTMLDecode, i, 4), ">", vbTextCompare) = 0 Then            HTMLDecode = Left$(HTMLDecode, i - 1) & ">" & Mid$(HTMLDecode, _                i + 4)        End If    LoopEnd Function

Share the Post:
data observability

Data Observability Explained

Data is the lifeblood of any successful business, as it is the driving force behind critical decision-making, insight generation, and strategic development. However, due to its intricate nature, ensuring the

Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular