Skip to main content

printing - How to print without having newline added automatically at the end?



Print["first part of the result", DateString[]]   
Print["addition to the result", DateString[]]

will add a newline character at the end of line automatically for each Print[]. But I'd like the two strings to be shown on the same line. How can I do this?



Answer



For Example:


WriteString["stdout", "First part of the result: ", DateString[]];
(*Perform some calc*)
i = 0;
WriteString["stdout", " -- Addition to the result: ", DateString[], "\n"];



First part of the result: Thu 15 Oct 2015 12:58:29 -- Addition to the result: Thu 15 Oct 2015 12:58:29



Comments