Skip to content

Instantly share code, notes, and snippets.

@TheArmagan
Created June 12, 2021 19:22
Show Gist options
  • Save TheArmagan/b431c93832c17790b176a681058ab979 to your computer and use it in GitHub Desktop.
Save TheArmagan/b431c93832c17790b176a681058ab979 to your computer and use it in GitHub Desktop.
function split(inputString, separateWith)
if separateWith == nil then
separateWith = ", "
end
local t={}
for str in string.gmatch(inputString, "([^"..separateWith.."]+)") do
table.insert(t, str)
end
return t
end
function join(inputTable, joinWith)
if joinWith == nil then
joinWith = ", "
end
return table.concat(inputTable, joinWith)
end
function repeatString(inputString, times)
if times == nil then
times = 1
end
local t = ""
for i = 1, times do
t = t..inputString
end
return t
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment