title: Lua - Match a string with item in array?
body: <p>I am new in Lua and I want to try display an item from an array, but it's like an array inside an array.</p>
  
  <p>This is my list:</p>
  
  <pre><code>local itemlist = {
      { name="blue car", price=5000 },
      { name="red car", price=10000 },
      { name="green car", price=2000 }
  }
  </code></pre>
  
  <p>And so if I would input the text "red car" I want it to output something like this:</p>
  
  <pre><code>The red car costs 10000 dollars.
  </code></pre>
  
  <p>How can I do this in lua?
  So far I have only found some string match examples where I can see if an array contains an item, but what I want is to output that AND the price. How do I get to the price? I have no idea where to even start.</p>