string.gsub

How could I replace all spaces with %20 to be used as a web address?

[lua]
local newString = string.gsub(oldString, “%s”, “%20”);
[/lua]

ERROR: Hook ‘Translate’ Failed: [@lua\autorun\client\ultratool.lua:120] invalid capture index
this is when there is a space

[lua]
url = url:gsub("%s","%%20")
[/lua]

Aha yeah, my bad. I’m tired.