Skip to content

to_string

Builtin · conversion

Convert any value to text. Analog of C++ std::to_string and Luau tostring.

string to_string(value);
NameTypeDescription
valueanyValue to convert.

string

tostring(value)

Use this when you need an explicit string — for example before storing in a StringValue, or when .: is not enough. Do not write Luau tostring in CL++ source.

Template strings already stringify interpolations: `coins {n}`.

int coins = 50;
string label = to_string(coins);
post("held " .: label);

Emits:

local coins: number = 50
local label: string = tostring(coins)
print("held " .. label)

to_number · to_bool · operator-concat · string