Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(str, char)
- local parts = {}
- local currentPart = {}
- for i = 1, str:len() do
- local c = str:sub(i, i)
- if c == char then
- table.insert(parts, table.concat(currentPart))
- currentPart = {}
- else
- table.insert(currentPart, c)
- end
- end
- table.insert(parts, table.concat(currentPart))
- return parts
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement