Search code examples
jsonline-breaks

How to break line in application / json files?


I have a text and would like to break lines in it, the format is application / json.

I used /n but sometimes it seems to work, and other no.

{"Text":"# hi  \n\n::: red \n\nImportant  \n bye"}

Thanks


Solution

  • Use \ for escape character before \n :

    {"Text":"# hi  \\n\\n::: red \\n\\nImportant  \\n bye"}