Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Creator: Bolodefchoco
- --Made in: 07/02/2016
- --Last update: 25/05/2016
- --[[ Notes:
- Does:
- Divide a string e vários pedaços de valores padronizados numa tabela
- Args:
- str --> String
- split --> Padrão do split (Exemplo: [^%s]+)
- id --> Tipo de split
- 0 == [^split]+
- 1+ == . * id
- ]]--
- string.split=function(str,split,id)
- local list={}
- for val in string.gmatch(str,id and (id==0 and '[^'..(split or '%s')..']+' or string.rep('.',id)) or split) do
- table.insert(list,val)
- end
- return list
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement