Add split string function
This commit is contained in:
parent
3941dd831f
commit
cf2a52eb8b
12
script.lua
12
script.lua
@ -34,6 +34,18 @@ function UV(uv)
|
|||||||
uv[2]/TEXTURE_HEIGHT
|
uv[2]/TEXTURE_HEIGHT
|
||||||
})
|
})
|
||||||
end
|
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
|
||||||
-- }}}
|
-- }}}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user