WoW:API tostring

From AddOn Studio
Revision as of 04:47, 15 August 2023 by Move page script (talk | contribs) (Move page script moved page API tostring to API tostring without leaving a redirect)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

WoW Lua

Returns the string representation of any value.

s = tostring(arg);

Arguments

arg
Any - Value to convert to a string.

Returns

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

Examples

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