Converting to a string

Basic types / Character type

-- No char type: a char is a string of length 1
local char_a = "A"
local char_type = type(char_a)
-- char_type = string
local char_length = #char_a
-- char_length = 1

local char_str = "character " .. char_a
-- char_str = character A

-- A char made from a code is a string too
local from_code = string.char(66)
-- from_code = B

print("char_type = " .. char_type)
print("char_length = " .. char_length)
print("char_str = " .. char_str)
print("from_code = " .. from_code)