|
|
|
Click here to copy the following block |
Public Function HTMLDecodeEx(ByVal Text As String, Optional ByVal vfHREFDecode _ As Boolean = False, Optional ByVal vstrAmpChar As String = "&") As String Dim astrTokens() As String Dim lngTotal As Long Dim lngCount As Long Dim strToken As String Dim strCode As String Dim lngPos As Long Dim astrReturn() As String Dim strReturn As String strReturn = Text If Trim$(strReturn) <> "" Then astrTokens = Split(Text, vstrAmpChar, -1, vbTextCompare) lngTotal = UBound(astrTokens) ReDim astrReturn(lngTotal) For lngCount = 0 To lngTotal strToken = astrTokens(lngCount) lngPos = InStr(1, strToken, ";", vbTextCompare) If (lngPos = 0) Then astrReturn(lngCount) = strToken Else strCode = Mid$(strToken, 1, lngPos) Select Case strCode Case "nbsp;" astrReturn(lngCount) = " " & Mid$(strToken, lngPos + 1) Case "quot;" astrReturn(lngCount) = """" & Mid$(strToken, lngPos + 1) Case "amp;" astrReturn(lngCount) = vstrAmpChar & Mid$(strToken, _ lngPos + 1) Case "lt;" astrReturn(lngCount) = "<" & Mid$(strToken, lngPos + 1) Case "gt;" astrReturn(lngCount) = ">" & Mid$(strToken, lngPos + 1) Case Else If Left$(strToken, 1) = "#" Then astrReturn(lngCount) = Chr$(Mid$(strToken, 2, _ lngPos - 2)) & Mid$(strToken, lngPos + 1) Else astrReturn(lngCount) = strToken End If End Select End If Next Erase astrTokens strReturn = Join(astrReturn, "") Erase astrReturn End If HTMLDecodeEx = strReturn End Function |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|