Z1maV1

StringTools

May 6th, 2024
202
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1. function split(str, sep)
  2. if sep == nil then
  3. sep = "%s"
  4. end
  5. local t = {}
  6. for str in string.gmatch(str, "([^"..sep.."]+)") do
  7. table.insert(t, str)
  8. end
  9. return t
  10. end
  11.  
  12. return { split = split }
Advertisement
Add Comment
Please, Sign In to add comment