WoW:API tostring: Difference between revisions

From AddOn Studio
Jump to navigation Jump to search
({{luaapi}})
m (Move page script moved page API tostring to API tostring without leaving a redirect)
 
(No difference)

Latest revision as of 04:47, 15 August 2023

WoW Lua

Returns the string representation of any value.

s = tostring(arg);

Arguments[edit]

arg
Any - Value to convert to a string.

Returns[edit]

s
String - string representation of the argument; possibly provided by the argument's metatable.

Examples[edit]

tostring(123)  --Returns "123"
tostring({})  --Returns "table: ###"
tostring(function() end) --Returns "function: ###"
tostring(nil) --Returns "nil"
tostring(true) --Returns "true"