function string.explode(str, sep) -- function by MatheusMkalo local dat = {} local lastsep = 0 for i = 1, #str do if str: sub(i, i+#sep-1) == sep then local addt = lastsep == 0 and str: sub(1, i-1) or str: sub(lastsep+#sep, i-1) if addt ~= "" then table.insert(dat, addt) end str = str:sub(1, i-1) .. str:sub(i+#sep-1) lastsep = i-#sep+1 end if #dat == 0 and i == #str then table.insert(dat, str) break end if i == #str then table.insert(dat, str: sub(lastsep+#sep, #str)) end end return dat end
Funçao string.explode dos ots em lua...
N funfa com pattern