tostring

string

Converts any value to a string representation

Syntax

tostring(value)

Parameters

value (any)

The value to convert to a string

Returns

string

String representation of the input value

Examples

Input:
42 | tostring
Output:
"42"
Input:
true | tostring
Output:
"true"
Input:
[1, 2, 3] | tostring
Output:
"[1,2,3]"

The tostring() function converts any value to its string representation. This is useful for data formatting, output preparation, and type conversion.

Usage

Use tostring() when you need to ensure a value is in string format, such as before concatenation or when preparing data for text-based output.

Related Functions