Jay Tillu
Jay Tillu

Reputation: 1548

Is there any way to accomplish the same output which is given by stdout.write(), as we can't use it on browsers in dart?

stdout.write()

I mostly use this function when I don't want the newline() after message. I know about print() but with the output, it also adds newline by default. stdout.write() don't add newline but I think it can't be used on browsers, it only works on dart VM.

So please can anyone show me how to achieve the same output as stdout.write() for browser-based work.

Upvotes: 0

Views: 57

Answers (1)

Alexandre Ardhuin
Alexandre Ardhuin

Reputation: 76223

print use console.log in browser so you cannot write text without newline (this behaviour is enforced by browser not Dart).

You can use a StringBuffer to append text without newline and call print(mybuffer) when you're ready to output your full line.

Upvotes: 1

Related Questions