title: string.find function functionality in Lua
body: <p>Below is my piece of code</p>
  
  <pre><code>str = "abc@hotmailcom"
  a = string.find(str , "@")
  print(a)
  </code></pre>
  
  <p><em>My output is 4 i.e place value of "@"</em></p>
  
  <p>But when I run the following piece of code</p>
  
  <pre><code>str = "abc@hotmailcom"
  a = string.find(str , ".")
  print(a)
  </code></pre>
  
  <p><em>instead of outputting "nil", the program returns the value 1.</em></p>
  
  <p>I am new to Lua language so could anyone explain to me what is happening and how string.find() works in lua?</p>