ElEditors, Administrators
70,766
edits
No edit summary |
No edit summary |
||
Line 38: | Line 38: | ||
-- Implement splitting string to a table. | -- Implement splitting string to a table. | ||
function split( | function split(s, delimiter) | ||
if delimiter == nil then delimiter = ',' end | |||
result = {}; | |||
for match in (s..delimiter):gmatch("(.-)"..delimiter) do | |||
table.insert(result, match); | |||
end | |||
return result; | |||
end | end |