Search code examples
kotlinintellij-idea

How can I stop IntelliJ IDEA printing an empty new line?


I am following the Atomic Kotlin course. I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different. Even when I copy and paste from the answer. Please see screenshot. incorrect output

I have tried using the print() method instead of println(), but it didn't help.


Solution

  • Go to Settings->Editor->General and uncheck the Ensure every line.. property.

    see the following screenshot (updated, thx to @Flobesst): enter image description here