I would like to print without skipping lines in Nim.
this is my code by far
int i = 1
for i in countup(1, 10):
echo "number: "
echo i
I would like the output to be:
number: (i value)
...
instead of:
number:
(i value)
I would like to print without skipping lines in Nim.
this is my code by far
int i = 1
for i in countup(1, 10):
echo "number: "
echo i
I would like the output to be:
number: (i value)
...
instead of:
number:
(i value)
You can also write to stdout
directly with
stdout.write "number: "
echo i
which will print a newline after printing the value of i
Convert i to a string with the $ operator, then concatenate the strings using the & operator.
echo "number: " & $i