Converts a value to a string.
A string.
Conversion functions, String functions
ToString(value[, encoding]) |
ToBase64, ToBinary, CharsetEncode; Using XML and WDDX in the Developing ColdFusion Applications
ColdFusion MX:
Parameter |
Description |
|---|---|
value |
Value to convert to a string; can be a simple value such as an integer, a binary object, or an XML document object. |
encoding |
The character encoding (character set) of the string. Optional for binary data, Generates an error if used for a simple value or XML document object.The following list includes commonly used values:
|
This function can convert simple values and binary values that do not contain Byte zero. If this function cannot convert a value, it throws an exception. This function can also convert an XML document object to a string XML representation.Adobe recommends that you use the CharsetEncode function to convert binary data to a string.

<cfscript>
myString="Hello ColdFusion, how are you?"
base64Value = toBase64(myString)
binaryValue = toBinary(base64Value)
stringValue = toString(binaryValue);
writeOutput(stringValue);
</cfscript>
Sign in to your account