Skip to content
Advertisement

Line breaks is not being followed on printing in Kotlin

I am getting this format from a json string:

JavaScript

When I print it, the line breaks (“n”) is not inserted. I get the Json string like so:

JavaScript

and use this reply as so:

JavaScript

Advertisement

Answer

Try the following function to process the line breaks and see if helps you in fixing the issue:

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement