Siebel eScript Language Reference > Siebel eScript Commands > Conversion Methods >

ToString() Method


This method converts its parameter to a string.

Syntax

ToString(value)

Parameter
Description

value

The value to be converted to a string

Returns

A value in the form of a Unicode string, the contents of which depends on value's original data type, according to the following table.

Data Type
Returns

Boolean

"false" if value is false; otherwise, "true"

null

The string "null"

number

If value is NaN, "NaN". If value is +0 or -0, "0"; if Infinity, "Infinity"; if a number, a string representing the number

object

The string "[object Object]"

string

value

undefined

The string "undefined"

Usage

This method converts its parameter to a Unicode string, the contents of which depend on value's original data type.

CAUTION:  The ToString() function is unique to Siebel eScript. Before using it, confirm that the JavaScript interpreter that will run the script supports Siebel eScript functions. Avoid using this function in a script that may be used with a JavaScript interpreter that does not support it.

Example

For an example, see eval() Method.

See Also

ToBuffer() Method
ToBytes() Method

Siebel eScript Language Reference