Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function string:split(sep)
- local sep, fields = sep or ":", {}
- local pattern = string.format("([^%s]+)", sep)
- self:gsub(pattern, function(c) fields[#fields+1] = c end)
- return fields
- end
Advertisement
Add Comment
Please, Sign In to add comment