when I require the string library, it cannot find it, probably because I am using an older version of Corona. Is there somewhere I can download the lua file for it? [import]uid: 116264 topic_id: 26116 reply_id: 326116[/import]
[lua]–str.lua
module(…, package.seeall)
split = function(str, pat)
local t = {}
local fpat = “(.-)” … pat
local last_end = 1
local s, e, cap = str:find(fpat, 1)
while s do
if s ~= 1 or cap ~= “” then
table.insert(t,cap)
end
last_end = e+1
s, e, cap = str:find(fpat, last_end)
end
if last_end <= #str then
cap = str:sub(last_end)
table.insert(t,cap)
end
return t
end[/lua]
Peach [import]uid: 52491 topic_id: 26116 reply_id: 105790[/import]
thanks, just what i needed. [import]uid: 116264 topic_id: 26116 reply_id: 106341[/import]
Great, marking as resolved [import]uid: 52491 topic_id: 26116 reply_id: 106630[/import]