print() without a newline in Dart?

2019-06-14 23:14发布

问题:

In Dart, I am using print() to write content to the console.

Is it possible to use print() without it automatically adding a newline to the output?

回答1:

You can use stdout:

stdout.write("foo");

will print foo to the console but not place a \n after it.

You can also use stderr. See:

How can I print to stderr in Dart in a synchronous way?



标签: dart