2
$\begingroup$

Print automatically generates a newline at the end of the expression that is being printed. How do you suppress this automatic newline?

$\endgroup$
2
  • $\begingroup$ So Print /@ {1, 2, 3}; should generate 123 below/in messages notebook? What about prints in future, should they append this 123? $\endgroup$
    – Kuba
    Jan 8, 2018 at 13:46
  • $\begingroup$ assemble what you want to print as a single expression first. $\endgroup$
    – george2079
    Jan 8, 2018 at 13:51

1 Answer 1

2
$\begingroup$

A solution to this problem is to write strings to the standard output directly. For instance,

WriteString[$Output, "aaa"];
WriteString[$Output, "bbb"];
$\endgroup$
1
  • $\begingroup$ It is not what Print does if one has PrintToConsole settings on. $\endgroup$
    – Kuba
    Jan 8, 2018 at 15:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.