Difference between revisions of "Tostring"
From ComputerCraft Wiki
m (removing API link) |
m (Lua -> ComputerCraft, to match tonumber's entry.) |
||
| Line 5: | Line 5: | ||
|returns=[[string (type)|string]] representation of the Object <var>o</var> | |returns=[[string (type)|string]] representation of the Object <var>o</var> | ||
|api= | |api= | ||
| − | |addon= | + | |addon=ComputerCraft |
|desc=Converts any passed object to it's string-representation. | |desc=Converts any passed object to it's string-representation. | ||
|examples= | |examples= | ||
Revision as of 18:26, 30 November 2012
| Converts any passed object to it's string-representation. | |
| Syntax | tostring(Object o) |
| Returns | string representation of the Object o |
| Part of | ComputerCraft |
| API | none |
Examples
| Convert an integer to a string | |
| Code |
local a = tostring(1) |
| Output | a = "1" (string) |
| Convert a float to a string | |
| Code |
local b = tostring(3.1415) |
| Output | b = "3.1415" (string) |