Add split string function

This commit is contained in:
NullBite 2022-03-16 20:04:37 -04:00
parent 3941dd831f
commit cf2a52eb8b
Signed by: nullbite
GPG Key ID: 6C4D545385D4925A

View File

@ -34,6 +34,18 @@ function UV(uv)
uv[2]/TEXTURE_HEIGHT
})
end
function splitstring (inputstr, sep)
if sep == nil then
sep = "%s"
end
local t={}
for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
table.insert(t, str)
end
return t
end
-- }}}