I am trying to use VS code to work on java files. I imported the file I created in eclipse, and while the code runs, the terminal seems to ignore the \r escapes in the printed string. When running in Eclipse the escapes are honored. When instead of escapes I use empty println() statements, empty lines are added, but not when I use \r.
Asked
Active
Viewed 17 times
0

tzvik15
- 123
- 1
- 11
-
1Have you tried `"\n"` instead? Or `System.lineSeparator()`? What exactly are you trying to achieve by `\r\r` if not an empty line? – deHaar Sep 07 '21 at 13:54
-
`\n` is a "new line". `\r` is a carriage return: It returns you to the start of the same line, not a new one. – nir shahar Sep 07 '21 at 13:57
-
Using \n works, which is great for future, but I would still want to know why \r does not - because if it is an indication that VS code does not support all that Eclipse does then maybe I shouldn't be using it? – tzvik15 Sep 07 '21 at 13:57
-
1VSCode is 100% better than Eclipse in any imaginable possible way. Stick to it :) – nir shahar Sep 07 '21 at 13:58
-
1Yes! That explains this quite clearly. Thanks! – tzvik15 Sep 07 '21 at 14:04