From: Douglas F Shearer Date: 2007-08-20T05:30:33+09:00 Subject: Re: Converting %2F back to / On 19 Aug 2007, at 21:15, Dipesh Batheja wrote: > I have a string which contains url. The forward slash in it > represented > in '%2F' and I want to convert this back to '/'. How can i do that? I had to the same thing a while back: def url_decode(s) s.gsub(/((?:%[0-9a-fA-F]{2})+)/n) do [$1.delete('%')].pack('H*') end end > s = "Hello there everyone!" => "Hello there everyone!" > u(s) => "Hello%20there%20everyone%21" > url_decode(u(s)) => "Hello there everyone!" Found this via google originally. Douglas F Shearer dougal.s@gmail.com http://douglasfshearer.com