toString

Serializes data to a string.

UTF-8 encoded by default.

Supports $(SUPPORTEDSTRUCTURES).

@property
toString
(
Format
Siryulize flags = Siryulize.none
T
)
()
if ()

Parameters

Format

Serialization format ($(SUPPORTEDFORMATS))

data T

The data to be serialized

Return Value

Type: auto

A string in the specified format representing the user's data, UTF-8 encoded

Examples

//3 as a JSON object
assert(3.toString!JSON == `3`);
//"str" as a JSON object
assert("str".toString!JSON == `"str"`);

Meta