Library of Functions


Description


Will convert the given argument (for example a number) to a string.

Usage and Arguments


tostring(argument)

  • argument: an argument of any type to be converted to a string.

Returned Values


string: a string equivalent to the content of the converted argument.

Examples


-- store the number 32 in myAge
local myAge = 32
 
-- explicitly convert the number to a string
local myString = tostring(myAge)
 
fibaro:debug("You are " .. myString .. " years old.")

See Also


tonumber
Lua reference manual 5.2: tostring