Having a jString : JString
value holding an "abc"
string inside I get "JString(abc)" : String
if I call jString.toString
. How do I get "abc" : String
instead?
To extract a value from JValue you can use any method described here: What is the most straightforward way to parse JSON in Scala?
For instance:
json.extract[String]
You can use 'render' function to convert any JValue to printable format. Then either 'pretty' or 'compact' will convert that to a String.
compact(render(json))
or
pretty(render(json))