tostring

From Garry's Mod
Jump to: navigation, search
 tostring( )

Contents

Description

Attempts to convert the value to a string. If the value is an object and its metatable has defined the __tostring metamethod, this will call that function.

print also uses this functionality.

Arguments

any value

The object to be converted to a string.

Returns

string

The string representation of the value.

Examples

Example

Convert a number to a string.

print(tostring(0x16))

Output:

22
Personal tools
Navigation