LolzPB

textlib

May 21st, 2020
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. function split(sep, st)
  2. local tab = {}
  3. local b = ""
  4. for i=0, #st do
  5. local let = string.sub(st, i, i)
  6. if let == sep then
  7. table.insert(tab, b)
  8. b = ""
  9. elseif i == #st then
  10. b = b..let
  11. table.insert(tab, b)
  12. b = ""
  13. else
  14. b = b..let
  15. end
  16. end
  17. return tab
  18. end
Advertisement
Add Comment
Please, Sign In to add comment