在Dart中没有换行符的print()吗? [英] print() without a newline in Dart?
本文介绍了在Dart中没有换行符的print()吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Dart中,我正在使用 print()
将内容写入控制台。
In Dart, I am using print()
to write content to the console.
是否可以使用 print()
而不自动在输出中添加换行符?
Is it possible to use print()
without it automatically adding a newline to the output?
推荐答案
您可以使用 stdout
:
stdout.write("foo");
会在控制台上显示 foo
而不是在其后放置 \n
。
will print foo
to the console but not place a \n
after it.
您也可以使用 stderr
。请参阅:
You can also use stderr
. See:
这篇关于在Dart中没有换行符的print()吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文