string Function | |
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
Nomenclature
expr | Required. 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.
-
We use the string function to convert the real
number to a string
-
We then use the string.split
function to split the string around the decimal point
-
Finally, we use the array.get_at
function to retrieve the second element (at index 1, the decimal portion of the original number)
$piStr = string(3.1416);
$piSplit = string.split($piStr, ".");
PRINT array.get_at($piSplit, 1); /* 1416 */