string.toString()

Get a String representation of the value.

Signature

toString() => String

Description

Returns a String representation of the calling value. If the calling value is a String, it returns the calling String. The calling String isn’t changed.

Parameters

None

Return value

Type Description

String

String representation of the calling String.

Examples

Confirm that the calling string type returns itself:

'foobar'.toString()
"foobar"

Get the String representation of a Time() value:

let t1 = Time.fromString("2099-10-20T21:15:09.890729Z")
t1.toString()
"2099-10-20T21:15:09.890729Z"

Get the String representation of a floating point number:

1.5.toString()
"1.5"
\