Search
 
SCRIPT & CODE EXAMPLE
 

LUA

lua list append

-- One can append an element to the end of an array with the function table.insert.
-- table.insert takes three arguments, the table, the position, and the value to insert.
-- By default the position is equal to the length of the table + 1, in other words it will append it to the end.

local t = {};

table.insert(t, "a"); -- Insert "a" at position 1.
table.insert(t, "c"); -- Insert "c" at position 2.
table.insert(t, 2, "b"); -- Insert "b" at position 2, therefore pushing the "c" to position 3.

for i,v in ipairs(t) do
	print(i, v); -- 1 "a", 2 "b", 3 "c".
end
Comment

PREVIOUS NEXT
Code Example
Lua :: print script lua 
Lua :: lua how to concatenate string 
Lua :: lua string count occurrence 
Lua :: roblox number between 1 and 10 
Lua :: round to the nearest number lua 
Lua :: What is transparency in roblox 
Lua :: lua string split 
Lua :: table.find lua 
Lua :: lua function 
Lua :: lua class 
Lua :: lua hash table length 
Lua :: lua string 
Lua :: check if player is in group 
Lua :: roblox set color of text 
Lua :: lua print table as string 
Lua :: lua print hi 
Matlab :: matlab string to int 
Matlab :: matlab for loop syntax 
Matlab :: matlab find roots of symbolic polynomial 
Basic :: basic latex document 
Basic :: NÃO CONSIGO MANDAR UM POST EM VBNET USANDO POSTMAN 
Elixir :: elixir defguard 
Elixir :: phoenix ecto preload 
Scala :: quantification scalaire 
Scala :: how to get absolute value in scala 
Actionscript :: mount_osxfuse: /Users/em/mount_dev: Input/output error 
Excel :: AND logic in excel formula 
Perl :: perl mechanize check mirror response for errors 
Pascal :: pascal cheat sheet pdf 
Gdscript :: godot progrssbar set max value in code 
ADD CONTENT
Topic
Content
Source link
Name
2+9 =