Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string_split = function(source, splitter)
- local last = 1
- local current
- local out = {}
- while (true) do
- current = source:find(splitter, last, true)
- if (not current) then
- break
- end
- table.insert(out, source:sub(last, current - 1))
- last = current + splitter:len()
- end
- table.insert(out, source:sub(last))
- return out
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement