Search
 
SCRIPT & CODE EXAMPLE
 

LUA

lua remove duplicates from table

local test = {1,2,4,2,3,4,2,3,4,"A", "B", "A"}
local hash = {}
local res = {}

for _,v in ipairs(test) do
   if (not hash[v]) then
       res[#res+1] = v -- you could print here instead of saving to result table if you wanted
       hash[v] = true
   end

end
Comment

PREVIOUS NEXT
Code Example
Lua :: insert item array pico8 
Lua :: What percentage of developers use Lua 
Lua :: how do i use the errors module luaassist 
Lua :: how to add a damage decimal in roblox studio 
Lua :: lua to float 
Lua :: roblox studio buying robux 
Lua :: lua text script 
Matlab :: num to string matlab 
Matlab :: matlab title with variable 
Matlab :: how to read dat file in matlab 
Matlab :: matlab label size 
Matlab :: matlab select element of matrix 
Matlab :: matlab text subscript 
Basic :: Python: create zipfile 
Basic :: whats up 
Elixir :: elixir after 
Elixir :: elixir fibonacci 
Elixir :: create new project phoenix 
Scala :: scala enum 
Scala :: scala yield how to share one loop 
Actionscript :: DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. 
Excel :: excel conditionally highlight rows based on column 
Perl :: perl slice array 
Perl :: what happened to perl 6 
Pascal :: case of pascal 
Gdscript :: gdscript for loop 
Abap :: the interface between the abap dictionary and the underlying database management system 
Assembly :: include code in latex 
Assembly :: enter 64 bit mode 
Javascript :: jquery vslidation remove spaces from input 
ADD CONTENT
Topic
Content
Source link
Name
6+2 =