For some reason my numbers are cut off in the fellow example. If someone knows what is causing this, or has a better pattern please share.
function Split(String, Pattern)
local Res = {}
for Query in string.gmatch(String, Pattern) do
table.insert(Res, Query)
end
return Res
end
local Table = Split('Hello world > User_-1', '[^.->]+')
for i,v in pairs(Table) do
print(v)
end
Output :
- Hello world
- User_-
Should be:
- Hello world
- User_-1
