Skip to content

Instantly share code, notes, and snippets.

@moorer2k
Created June 3, 2018 04:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moorer2k/d47959e63ebbf2f2f2ad5d2b6e58f296 to your computer and use it in GitHub Desktop.
Save moorer2k/d47959e63ebbf2f2f2ad5d2b6e58f296 to your computer and use it in GitHub Desktop.
decodeURI Javascript equivlent for VB.NET. When DecodeURL / Unescape does not work for you.
Public Function DecodeUri(ByVal inputText As String)
Dim rx As New System.Text.RegularExpressions.Regex("(\\x.{2})")
For Each m As System.Text.RegularExpressions.Match In rx.Matches(inputText)
inputText = inputText.Replace(m.Groups(1).Value, Chr(m.Groups(1).Value.Replace("\x", "&H")))
Next
Return inputText
End Function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment