mad1231999

Untitled

Jan 27th, 2013
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.20 KB | None | 0 0
  1. function string:split(sep)
  2.     local sep, fields = sep or ":", {}
  3.     local pattern = string.format("([^%s]+)", sep)
  4.     self:gsub(pattern, function(c) fields[#fields+1] = c end)
  5.     return fields
  6. end
Advertisement
Add Comment
Please, Sign In to add comment