Advertisement
jille_Jr

Lua: table.contains()

Sep 28th, 2012
400
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.16 KB | None | 0 0
  1. function table_contains(table, element)
  2.   for _, value in pairs(table) do
  3.     if value == element then
  4.       return true
  5.     end
  6.   end
  7.   return false
  8. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement