lua first char of string

-- get the first character of a string
local myString = "Hello"
local firstChar = string.sub(myString, 1, 1)
print(firstChar)
  1. Declare a variable myString and assign the value "Hello" to it.
  2. Declare a variable firstChar and use the string.sub function to get a substring of myString starting at position 1 and ending at position 1.
  3. Print the value of firstChar to the console.