VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



HTMLDecode Function

by alexk (9 Submissions)
Category: VB function enhancement
Compatability: ASP (Active Server Pages)
Difficulty: Beginner
Date Added: Sun 7th February 2021
Rating: (1 Votes)

ASP Has a useful Server.HTMLEncode feature but there is no HTMLDecode. This is a simple way to overcome that.

Rate HTMLDecode Function

Function HTMLDecode(sText)
    Dim I
    sText = Replace(sText, """, Chr(34))
    sText = Replace(sText, "<"  , Chr(60))
    sText = Replace(sText, ">"  , Chr(62))
    sText = Replace(sText, "&" , Chr(38))
    sText = Replace(sText, " ", Chr(32))
    For I = 1 to 255
        sText = Replace(sText, "&#" & I & ";", Chr(I))
    Next
    HTMLDecode = sText
End Function

Download this snippet    Add to My Saved Code

HTMLDecode Function Comments

No comments have been posted about HTMLDecode Function. Why not be the first to post a comment about HTMLDecode Function.

Post your comment

Subject:
Message:
0/1000 characters