coerce.to-string

coerce.to-string attempts to parse unknown data to a string. It is a flexible method, and will attempt to take any primitive data type and encode it as a string.

Function category: Coercion

Syntax

coerce.to-string(arg1)

Arguments

Description

arg1

Any datum.

Examples

Example 1: Boolean to string

If we have a function that is given a Boolean as its argument, this function returns a string value.

# Boolean to string
coerce.to-string(true)
# Returns "true"

Example 2: Integer to string

If we have a function that is given an integer as an argument, this function returns a string.

# Integer to string
coerce.to-string(1.1)
# Returns "1.1"

Notes