title: What does # mean in Lua?
body: <p>I have seen the hash character '#' being added to the front of variables a lot in Lua.</p>
  
  <p>What does it do? </p>
  
  <p>EXAMPLE</p>
  
  <pre><code>-- sort AIs in currentlevel
  table.sort(level.ais, function(a,b) return a.y &lt; b.y end)
  local curAIIndex = 1
  local maxAIIndex = #level.ais
  for i = 1,#currentLevel+maxAIIndex do
      if level.ais[curAIIndex].y+sprites.monster:getHeight() &lt; currentLevel[i].lowerY then
          table.insert(currentLevel, i, level.ais[curAIIndex])
          curAIIndex = curAIIndex + 1
          if curAIIndex &gt; maxAIIndex then
              break
          end
      end
  end
  </code></pre>
  
  <p>Apologies if this has already been asked, I've searched around on the internet a lot but I haven't seem to have found an answer. Thanks in advance!</p>