Name
ToString -- convert any data type to a string (V2.0)
Synopsis
s$ = ToString(data)
Function
This function can convert any type to a string. You can pass in tables, functions, strings, numbers and Nil. ToString() is also used by the Print() and DebugPrint() commands so they can print any types, too.

Additionally, if you pass in a table which metatable has a __tostring field, this metamethod is called.

Inputs
data
value to convert to string
Results
s$
a string
Example
s$ = ToString(DisplayBrush)   ; returns "Function: 74cd2456"
s$ = ToString({1,2,3,4,5})    ; returns "Table: 74ab1344"
s$ = ToString(Nil)            ; returns "Nil"
s$ = ToString(5)              ; returns "5"
s$ = ToString("Hello")        ; returns "Hello"

Show TOC