toJson

fun <T> toJson(obj: T, pretty: Boolean = false): String

Writes the content of obj into a JSON string.

This method additionally converts all NUL characters (\u0000) to ^@ for display.

Parameters

pretty

Whether to pretty-print the JSON string.