Last active
September 2, 2019 21:37
-
-
Save doyousketch2/5dfe0b1a6fe2daaefee4d73da91879b4 to your computer and use it in GitHub Desktop.
stringSplit.Lua
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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