toString (Function)
Signature: toString(value: int8 | int16 | int32 | int | uint8 | uint16 | uint32 | float16 | float32 | float | bool | string | Unit | any | Result<printable, printable>) -> string
Description: Formats the same scalar and Result values accepted by print without writing output. Unit renders as 0.
Parameters
- value (
int8 | int16 | int32 | int | uint8 | uint16 | uint32 | float16 | float32 | float | bool | string | Unit | any | Result<printable, printable>): The value to convert to string
Returns: string
Example
let str = toString(42)
print(str) // Prints: 42
str = toString 42
print str // Prints: 42