Replace ignores text it should replace at the beginning of source string:
This if you want to replace %2F with / in this string
%2Fsomeurl%2Fpath%2F
You will get back
%2Fsomeurl/path/
The nasty workaround is to put extra characters at start of string, and you have to put a string LONGER than your replace code. For example:
Function unEscape(source As String) As String
Dim find(1 To 4) As String
Dim repl(1 To 4) As String
find(1) = "%2F"
repl(1) = "/"
find(2) = "%3F"
repl(2) = "?"
find(3) = "%26"
repl(3) = "&"
find(4) = "%3D"
repl(4) = "="
unEscape = Mid$(Replace("xxxx" + source, find, repl, 5), 5)
End Function
Nice one IBM, words fail.
Simon