Newline Characters
How do I type in newline characters? Is there some kind of shortcut? Because currently I copy and pasted it from another person's repl.
Voters
mwilki7
If you ever have the misfortune of running your programs on windows machines you may also have to add "\r\n" if "\n" doesn't work.
DynamicSquid
\n
for example:
System.out.print("Hello\nWorld")
will print:
Hello World
or
System.out.println("Hello"); System.out.println("World");
will print out:
Hello World
@posiedon7776 Hi,
You can use
\n
(backslash n) for printing the statement in the next line:-You will get the next statement (
World
) in the different line.That's it
Thanks!
Hope this helps