Skip to content

Instantly share code, notes, and snippets.

@doyousketch2
Last active September 2, 2019 21:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save doyousketch2/5dfe0b1a6fe2daaefee4d73da91879b4 to your computer and use it in GitHub Desktop.
Save doyousketch2/5dfe0b1a6fe2daaefee4d73da91879b4 to your computer and use it in GitHub Desktop.
stringSplit.Lua
-- modification of String split by luk3yx
-- https://gitlab.com/snippets/1756106
string.split = function(str, chr)
local s, e = str:find(chr)
local r = {}
local i = 1
while s do
r[#r + 1] = str:sub(i, s - 1)
i = e
s, e = str:find(chr, i)
end
return r
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment