vibe.d beta banner
get vibe.d
0.10.1

Asynchronous I/O that doesn’t get in your way, written in D

Function Json.toPrettyString

Returns the JSON object as a "pretty" string.

string toPrettyString (
  int level = 0
) @trusted const;
auto json = Json(["foo": Json("bar")]);
writeln(json.toPrettyString());

// output:
// {
//     "foo": "bar"
// }

Parameters

NameDescription
level Specifies the base amount of indentation for the output. Indentation is always done using tab characters.

See Also

writePrettyJsonString, toString

Authors

Sönke Ludwig

Copyright

© 2012-2015 RejectedSoftware e.K.

License

Subject to the terms of the MIT license, as written in the included LICENSE.txt file.