Skip to content

Instantly share code, notes, and snippets.

@cxmeel
Created October 23, 2023 17:05
Show Gist options
  • Save cxmeel/f27c0e6b36d322014c741f05588d9681 to your computer and use it in GitHub Desktop.
Save cxmeel/f27c0e6b36d322014c741f05588d9681 to your computer and use it in GitHub Desktop.
Luau Snippets

Luau Snippets

A collection of Luau snippets that can be copied and pasted directly into your code.

UrlDecode

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment