Forum > General

Stringifying a TJSONObject

(1/1)

Frogfather:
Hello,

I'm looking for a way to convert a TJSONObject to a string, much the same way as JSON.stringify does it in JS.

I'd thought that TJSONStreamer.ObjectToJSONString() would do the trick, but this returns '{}' despite the fact that the JSON object being passed in definitely has properties.

If the above is the correct approach could someone advise what I'm doing wrong? Otherwise is there a way to do this without rolling my own solution?

Thanks in advance

John C

y.ivanov:
Obj.AsJSON?

Frogfather:
Sometimes the answer is staring you in the face  :-[
Many thanks!

y.ivanov:
You can look at FormatJSON function also, it has some handy format options.

Navigation

[0] Message Index

Go to full version