Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- setfenv(1,{print=print,setmetatable=setmetatable,type=type,getmetatable=getmetatable})
- local table={
- sub=function(tab,a,b)
- local g={}
- for i=a,b do
- if tab[a] and tab[b] then
- table.insert(g,i)
- end
- end
- return g
- end,
- concat=function(tab)
- local new=""
- for i=1,#tab do
- new=new..tab[i]
- end
- return new
- end,
- meta=function(tab,tab2)
- if tab and tab2 then
- setmetatable(tab,tab2)
- end
- end,
- insert=function(tab,val)
- tab[#tab+1]=val
- end,
- remove=function(tab,val)
- if type(val)~="number" then
- for _,v in next,tab do
- if v==val then
- tab[_]=nil
- end
- end
- else
- tab[val]=nil
- end
- end,
- find=function(tab,val)
- if tab then
- for _,v in next,tab do
- if v==val then
- return true
- else
- return false
- end
- end
- end
- end,
- removeStrings=function(tab)
- for i=1,#tab do
- if type(tab[i])=="string" then
- tab[i]=nil
- end
- end
- end,
- removeNums=function(tab)
- for i=1,#tab do
- if type(tab[i])=="number" then
- tab[i]=nil
- end
- end
- end,
- wipe=function(tab)
- for i=1,#tab do
- tab[i]=nil
- end
- end
- }
- table.link=function(tab1,tab2)
- local g={}
- for i=1,#tab1 do
- table.insert(g,tab1[i])
- end
- for i=1,#tab2 do
- table.insert(g,tab2[i])
- end
- return g
- end
- table.copy=function(tab)
- local g={}
- for i=1,#tab do
- table.insert(g,tab[i])
- end
- return g
- end
- table.cut=function(tab)
- local g={}
- for i=1,#tab do
- table.insert(g,tab[i])
- table.remove(tab,i)
- end
- return g
- end
- table.display=function(tab)
- for i=1,#tab do
- print(tab[i])
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement