A collection of Luau snippets that can be copied and pasted directly into your code.
Decodes a URL-encoded string back into human-readable characters.
UrlDecode("https%3A%2F%2Fcreate%2Eroblox%2Ecom") -- "https://create.roblox.com"
--!strict | |
local function UrlDecode(input: string) | |
local output = input:gsub("%%(%x%x)", function(match) | |
return string.char(tonumber(match, 16) :: number) | |
end) | |
return output | |
end |