I found this function
function explode(div,str)
if (div=='') then return false end
local pos,arr = 0,{}
-- for each divider found
for st,sp in function() return string.find(str,div,pos,true) end do
-- Attach chars left of current divider
table.insert(arr,string.sub(str,pos,st-1))
pos = sp + 1 -- Jump past current divider
end
-- Attach chars right of last divider
table.insert(arr,string.sub(str,pos))
return arr
end
and now my textfile looks like this: my name my home townXZXmy shoe sizeXZXmy ageXZXmy height
Making me get this array whit my variables.
local varArray = explode("XZX", contents)
Is thee a better way? [import]uid: 28895 topic_id: 6665 reply_id: 23619[/import]