title: Lua split string by semicolon
body: <p>How to split string in Lua by semicolon?</p>
  
  <pre><code>local destination_number="2233334;555555;12321315;2343242"
  </code></pre>
  
  <p>Here we can see that multiple times occurrence of semicolon (;) but I need output from above string only before first occurrence.</p>
  
  <p>Tried code : </p>
  
  <pre><code>if string.match(destination_number, ";") then
      for token in string.gmatch(destination_number, "([^;]+),%s*") do
          custom_destination[i] = token
          i = i + 1
  
      end 
  end
  </code></pre>
  
  <p>Output :</p>
  
  <pre><code>2233334
  </code></pre>
  
  <p>I have tried  above code but newbie to Lua scripting so can't get exact syntax for that.</p>