Page tree

Welcome to FreeSoftwareServers Confluence Wiki

Skip to end of metadata
Go to start of metadata

https://stackoverflow.com/a/32495481/5079799

Public Function URLDecode(StringToDecode As String) As String
 Dim TempAns As String
 Dim CurChr As Integer
 CurChr = 1
 Do Until CurChr - 1 = Len(StringToDecode)
  Select Case Mid(StringToDecode, CurChr, 1)
    Case "+"
      TempAns = TempAns & " "
    Case "%"
      TempAns = TempAns & Chr(Val("&h" & _
         Mid(StringToDecode, CurChr + 1, 2)))
       CurChr = CurChr + 2
    Case Else
      TempAns = TempAns & Mid(StringToDecode, CurChr, 1)
  End Select
 CurChr = CurChr + 1
 Loop
 URLDecode = TempAns
End Function
  • No labels