Pinkishu

Untitled

Jul 12th, 2012
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.32 KB | None | 0 0
  1. function split(str,delim)
  2.   local ret = {}
  3.   while true do
  4.     local s,e = string.find(str,delim,1,true)
  5.     print("STR: "..str)
  6.     print(s.."/"..e)
  7.     if s and e then
  8.       table.insert(ret,string.sub(str,1,s-1))
  9.       str = string.sub(str,e+1)
  10.       print(str)
  11.     else
  12.       break
  13.     end
  14.   end
  15.   return ret
  16. end
Advertisement
Add Comment
Please, Sign In to add comment