简体   繁体   English

如何停止 IntelliJ IDEA 打印空的新行?

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

I am following the Atomic Kotlin course.我正在学习 Atomic Kotlin 课程。 I have understood the concept and my output is correct, however Intellij IDEA complains that the outputs are different.我已经理解了这个概念并且我的输出是正确的,但是 Intellij IDEA 抱怨输出不同。 Even when I copy and paste from the answer.即使我从答案中复制和粘贴。 Please see screenshot.请看截图。 错误的输出

I have tried using the print() method instead of println() , but it didn't help.我尝试使用print()方法而不是println() ,但没有帮助。

Go to Settings->Editor->General and uncheck the Ensure an empty line.. property.转到Settings->Editor->General并取消选中Ensure an empty line..属性。

see the following screenshot:请参阅以下屏幕截图: 在此处输入图片说明

There is a straightforward workaround on how one can avoid this problem.关于如何避免此问题,有一种简单的解决方法。 Changing the AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt manually to add a new line at the end of the text should fix the test. AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt更改AtomicKotlin/Programming Basics/Data Types/Exercise 2/test/output.txt以在文本末尾添加新行应该可以修复测试。
I've also found a YouTrack ticket with the problem description.我还找到了一张带有问题描述的YouTrack 票 According to it, EduTools 4.2 version release should fix it.根据它,EduTools 4.2 版本发布应该修复它。 Maybe it worth to upvote or comment on the ticket.也许值得对票进行投票或评论。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 Kotlinizing Java 文件时,如何阻止 IntelliJ IDEA 将方法转换为属性? - How can I stop IntelliJ IDEA from turning methods into properties when Kotlinizing a Java file? 如何在IntelliJ IDEA中忽略针对Kotlin的所有警告? - How can I ignore all warnings for Kotlin in IntelliJ IDEA? 如何在 intellij idea 中添加我自己的 dukat 版本 - How can I add my own version of dukat in intellij idea 如何在 IntelliJ IDEA 中配置新的 Maven 项目? - How to configure new Maven project in IntelliJ IDEA? 编写Kotlin代码时无法在IntelliJ IDEA中停止 - Can't stop at exception in IntelliJ IDEA while writing Kotlin code intellij想法中的新Kotlin类 - New Kotlin class in intellij idea 如何在IntelliJ IDEA / Android Studio中添加自定义Kotlin后缀完成? - How can I add a custom Kotlin postfix completion in IntelliJ IDEA / Android Studio? 如何在IntelliJ IDEA中配置用于暂存文件的Kotlin版本? - How can I configure the Kotlin version used for scratch files in IntelliJ IDEA? 如何在 Intellij Idea 中从 GitHub 打开 Kotlin 文件? - How do I open Kotlin file from GitHub in Intellij Idea? 如何格式化字符串以在 PDF 中打印新行-未正确打印新行-Kotlin - How to format String for printing new line in PDF- not printing new line correctly- Kotlin
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM