Posted 28 September 2014 - 07:00 AM
I've been trying to code a simple file format for color files but this function returns an empty table:
function splitAt(chrchtr,strng,strt)
local ch = strt or 1
local parts = {}
local str = ""
local lngth = string.len(strng) - ch + 1
for i = 1,lngth do
if strng.sub(strng,ch,ch) == chrctr then
table.insert(parts,str)
str = ""
else
str = str..string.sub(strng,ch,ch)
end
ch = ch + 1
end
return parts
end
This is the line that calls the code:
local args = splitAt(",",fnc(This is a function!,lol/test,[]),5)