Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function split(string_,delimiter)
- local result = { }
- local from = 1
- local delim_from, delim_to = string.find( string_, delimiter, from )
- while delim_from do
- table.insert( result, string.sub( string_, from , delim_from-1 ) )
- from = delim_to + 1
- delim_from, delim_to = string.find( string_, delimiter, from )
- end
- table.insert( result, string.sub( string_, from ) )
- return result
- end
Advertisement
Add Comment
Please, Sign In to add comment