Mock
Not unsefull but funny.
Lua:
function string.impode(arr,sep) --- by Mock
local str = ""
sep = sep or ""
for i=1,#arr do
str = str..tostring(arr[i])..sep
end
return str:sub(1,str:len()-1)
end
Lua:
text = string.impode({'hi','my','name','its',false,print},'+')
print(text)
It's opossit of string.explode.
------------------------------------------
array
If you use PHP you know, arrays you must need use: array($v1,$v2,$v3,...)
now in lua you can do it! xD
i do it because i'm bored.
prepare yourself to see most biggest wrold function!
Lua:
function array(...) -- By mock
return {...}
end
Using it:
Lua:
table_ = array(cid,name,pos,var)
print('My name is: '..table_[2])