toFormattedString

fun JsonElement.toFormattedString(indent: String = " "): String

Encodes this JsonElement as a pretty-printed JSON string.

Extension function on JsonElement.

Return

the formatted JSON string

Parameters

indent

the indentation string to use (defaults to two spaces)