title: How to iterate individual characters in Lua string?
body: <p>I have a string in Lua and want to iterate individual characters in it. But no code I've tried works and the official manual only shows how to find and replace substrings :(</p>
  
  <pre><code>str = "abcd"
  for char in str do -- error
    print( char )
  end
  
  for i = 1, str:len() do
    print( str[ i ] ) -- nil
  end
  </code></pre>