tostring

 Note: If used on a table, this function will return table: address where address is the memory address of the table. To turn the actual table contents into a string, use textutils.serialise.

tostring
Function
Syntax
tostring(
  • x : any The value to convert to a string.
)

Returns string
API Base globals
Source Lua (source)

Converts x to a string.

 Note: You can also use x.."".

ExampleConvert a number to a string.
Takes the number 64, converts it to a string and then prints it.
Code
<nowiki>
local stringFromNumber = tostring(64)
print(stringFromNumber)
    </nowiki>
Output
64
This article is issued from Computercraft. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.