Avatar of renisenbe
renisenbe

asked on 

Need newlines in json output from Java String

Desired JSON output:
{"key":"value1  
           value2
           value3"}  

In Java,
String s = "value1 \\n value2 \\n value3"

but the output is just {"key":"value1 \\n value2 \\n value3"}
I have tried \n, \\n, \\\n, \\\\n and none worked.
JavaJSON

Avatar of undefined
Last Comment
girionis

8/22/2022 - Mon