> For the complete documentation index, see [llms.txt](https://trizen.gitbook.io/sidef-lang/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://trizen.gitbook.io/sidef-lang/programming_tasks/u/url_decoding.md).

# URL decoding

```ruby
func urldecode(str) {
    str.gsub!('+', ' ')
    str.gsub!(/\%([A-Fa-f0-9]{2})/, {|a| 'C'.pack(a.hex) })
    return str
}
 
say urldecode('http%3A%2F%2Ffoo+bar%2F')   #=> "http://foo bar/"
```
