Click or drag to resize

string Function

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
string Function

The string function converts a given expression to a string.

Syntax

Alchemy
string(expr);

Nomenclature

exprRequired. An expression to convert to a string

Returns

The string representation of the given expression.

Example

The example below retrieves the decimal portion of a real number.

  1. We use the string function to convert the real number to a string
  2. We then use the string.split function to split the string around the decimal point
  3. Finally, we use the array.get_at function to retrieve the second element (at index 1, the decimal portion of the original number)
Alchemy
$piStr = string(3.1416);
$piSplit = string.split($piStr, ".");
PRINT array.get_at($piSplit, 1); /* 1416 */