function split(str,delim)
assert (type (delim) == "string" and string.len (delim) > 0,"bad delimiter")
if delim==nil then
delim="%s"
end
table={}
i=1
for w in string.gmatch(str,"[^"..delim.."]+") do
table[i]=w
i=i+1
end
return table
end
assert (type (delim) == "string" and string.len (delim) > 0,"bad delimiter")
if delim==nil then
delim="%s"
end
table={}
i=1
for w in string.gmatch(str,"[^"..delim.."]+") do
table[i]=w
i=i+1
end
return table
end