Variant

toString() [Variant class]

Returns the value of the variant to an String (an ASCII or UTF-8 string) and returns a copy of it, converting the type if necessary. The original value is left unchanged.

Source Result
bool false → "0", true → "1"
numeric converted to a string (decimal ASCII)
String unchanged
other conversion fails

There are two overloads, one that takes an ok parameter passed by reference, which is filled in as true if the data is already this type or can be converted.

// PROTOTYPES
String toString() const;
String toString(bool& ok) const;

See value, as, and to for when to use the toXXX() vs. other accessors.